Created
October 29, 2014 19:45
-
-
Save garybernhardt/e4910b80e8ccda9f3538 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find $(manpath | tr ':' '\n') -iname '*.1' | xargs cat | (LC_CTYPE=C tr -C '[:alnum:]-_' '\n') | egrep '^--[\-_[:alnum:]]+$' | sort | uniq -c | sort -n |
OS X's zcat append ".Z" to all paths not already ending with it, so that doesn't work. Using gzcat instead fails because it tries to decompress everything, so uncompressed man pages blow up. I bet that Ubuntu has saved its users as much as ten megabytes of disk space by compressing the man pages! :/
triple click selects full lines of text, which is useful for situations like this (although I don't know whether various Linux dinguses will do the right thing there; probably not)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(FWIW, if I were chasing portability in shell programming, I'd probably punt on making this a one-liner. Make a script, define well-named functions, make their composition evident, then futz with implementation details of each function.)