Skip to content

Instantly share code, notes, and snippets.

@adamryman
Last active December 22, 2016 01:44
Show Gist options
  • Save adamryman/c3ceababa26916630d9a0716b9c96ae1 to your computer and use it in GitHub Desktop.
Save adamryman/c3ceababa26916630d9a0716b9c96ae1 to your computer and use it in GitHub Desktop.
Gives you a random man page of one of the executables in your path
#!/bin/bash
# randman, gives you a random man page from your path
# Copy the line below to your .bashrc to add a simple alias
# alias randman="until for binpath in ${PATH//:/$' '}; do ls ${binpath}; done | shuf | head -1 | xargs man; do :; done"
until
for binpath in ${PATH//:/$' '}; do
ls ${binpath};
done | shuf | head -1| xargs man;
do :;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment