1. 6

Following a recent post about shuffle and sample on the command line, I figured there could potentially be a website that aggregates neat tricks with various commands at the command line. People could submit what I like to call “UNIX hacks”, which would be categorized by command, and they’d have a brief description of what the command does. The website could have hover text similar to Genius.com as a means of explaining what each portion of the command does, if necessary.

Here are some examples I’d have on the website:

seq

  • Sequence from 1 to 5: seq 5
  • Same sequence, shuffled: seq 5 | shuf
  • Pick 5 from 1..100: seq 100 | shuf -n 5

git

  • One-liner for every commit: git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
  • List each branch with age, name, and last committer: for ref in $(git for-each-ref --sort=-committerdate --format="%(refname)" refs/heads/ refs/remotes ); do git log -n1 $ref --pretty=format:"%Cgreen%cr%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset%n" | cat ; done | awk '"'! a["'$0'"]++'
  • And so on …
  1.  

  2. 8

    So, basically commandlinefu.com?

    1. 1

      Dude, nice. Thank you!

      Edit: It seems that this isn’t quite the same idea – the website definitely could use a new design, that’s for sure.

      1. 3

        Also worth mentioning explainshell.com