Skip to content

Instantly share code, notes, and snippets.

@aprescott
Last active December 13, 2015 22:08
Show Gist options
  • Save aprescott/4982269 to your computer and use it in GitHub Desktop.
Save aprescott/4982269 to your computer and use it in GitHub Desktop.
Find your longest man pages.
# Finds your longest man pages by counting `man n foo | wc -l`
# for all man pages available.
man -k . |
sed -e 's/(//' -e 's/)//' |
awk '{ print $2, $1 }' |
xargs -n 1 -I {} bash -c "echo -n -e "{}"'\t'; man "{}" | wc -l" 2>/dev/null |
awk -F$'\t' 'BEGIN { max = 0 } { if ($2 > max) { max = $2; print "max found: " max " (" $1 ")" } }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment