Explain a Command

A quick way to see what commands and their options do before running them.

Delete files extracted from a tarball
tar -tf file.tar.gz | xargs rm -r
tar
tar(1)
an archiving utility
-t
-t, --list

List the contents of an archive.  Arguments are optional.  When given, they specify the names of the members to list.

-f file.tar.gz
-f, --file=ARCHIVE

Use archive file or device ARCHIVE.  If this option is not given, tar will first examine the environment variable `TAPE'. If it is set, its value will be used as the archive name.  Otherwise, tar will assume the compiled-in default.  The default value can be inspected either using the --show-defaults option, or at the end of the tar --help output.

An archive name that has a colon in it specifies a file or device on a remote machine.  The part before the colon is taken as the machine name or IP address, and…

|
xargs
xargs(1)
build and execute command lines from standard input
rm
rm(1)
remove files or directories
-r
-r, -R, --recursive

remove directories and their contents recursively

Share

Sample Commands

Delete files extracted from a tarball
tar -tf file.tar.gz | xargs rm -r

Generate a random 16-char password
strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 16 | tr -d '\n'

Print the largest files or folders in the current dir
du -s * | sort -n | tail

Read More

From our blog:

Want to build something like this? Have a look at ManKier's API.

For another take on explaining commands, check out explainshell.com.