Skip to content

Instantly share code, notes, and snippets.

@ekyo
Created August 29, 2013 21:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ekyo/6383547 to your computer and use it in GitHub Desktop.
Save ekyo/6383547 to your computer and use it in GitHub Desktop.
add the following to your .zshrc to be able to use 'explain' Example Use: > explain ls -ltrsa list directory contents -l use a long listing format -t sort by modification time, newest first -r, --reverse reverse order while sorting -s, --size print the allocated size of each file, in blocks -a, --all do not ignore entries starting with .
explain(){ curl -s $(echo "http://explainshell.com/explain/$1?args=${@:2}" | sed -e 's/ /+/g') |
sed -n '/<pre/,/<\/pre>/p' | sed -s 's/<[^>]*>//g' | sed -e 's/^ *//g;s/ *$//g' | grep '.' | cat }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment