Skip to content

Instantly share code, notes, and snippets.

@EvanDotPro
Last active December 14, 2015 21:09
Show Gist options
  • Save EvanDotPro/5149068 to your computer and use it in GitHub Desktop.
Save EvanDotPro/5149068 to your computer and use it in GitHub Desktop.
Little script to show a random manpage for a standard bash command.
#!/usr/bin/env sh
##
## lrn2bash - Show a random manpage.
##
## Author: Evan Coury, http://blog.evan.pro/
## URL: https://gist.github.com/EvanDotPro/5149068
##
## Installation or Upgrade:
##
## mkdir -p ~/bin && rm -f ~/bin/lrn2bash && wget -q https://gist.github.com/EvanDotPro/5149068/raw/lrn2bash -O ~/bin/lrn2bash && chmod +x ~/bin/lrn2bash
##
man $(commands='arch banner base64 basename bg cal cat cd chcon chgrp chmod chown chroot cksum cmp comm cp cron csplit cut date dc dd df dir dircolors dirname du echo ed env ex exit expand expr factor false fg file finger fmt fold fsck fuser grep groups head help history host hostid iconv id ifconfig inetd install join kill killall less link ln locate logname lp lpr ls lsattr lsof manbc md5sum mesg mkdir mkfifo mknod mktemp more mount mv netcat netstat nice nl nohup nslookup od passwd paste pathchk pax pgrep pidof ping pinky pkill pr printenv printf ps pstree ptx pwd rdate readlink rlogin rm rmdir route runcon sed seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf size sleep sort spell split ssh stat strings stty su sudo sum sync tac tail talk tee test time timeout topclear touch tput tr traceroutefind true trueandfalse truncate tsort tty type umaskat uname unexpand uniq unlink unset uptime users vdir vi w wait wall wc whatis whereisapropos who whoami writeawk xargsalias yes yesdig'; printf '%s\n' $commands | shuf | head -n1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment