Created
August 30, 2013 11:47
-
-
Save ekyo/6389069 to your computer and use it in GitHub Desktop.
Bash script for querying explainshell.com from the command line. Requires curl to be installed.
This file contains 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
#!/bin/bash | |
URL=$(echo "http://explainshell.com/explain/$1?args=${@:2}" | sed -e 's/ /+/g') | |
curl -s "$URL" | sed -n '/<pre/,/<\/pre>/p' | sed -n '/<pre/,/<\/pre>/p' | sed -s 's/<[^>]*>//g' | \ | |
sed -e 's/^ *//g;s/ *$//g' | grep '.' | cat |
Exemple Usage:
> 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 .
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
to install: