Explain a Command

Check what a command does, share a command with an automatic detailed explanation.

find
find(1)
search for files in a directory hierarchy
.
-name test
-name pattern

Base of file name (the path with the leading directories removed) matches shell pattern pattern. Because the leading directories of the file names are removed, the pattern should not include a slash, because `-name a/b' will never match anything (and you probably want to use -path instead). An exception to this is when using only a slash as pattern (`-name /'), because that is a valid string for matching the root directory "/" (because the base name of "/" is "/"). A warning is issued if you try to pass a…

-delete
-delete

Delete files or directories; true if removal succeeded. If the removal failed, an error message is issued and find's exit status will be nonzero (when it eventually exits).

Warning: Don't forget that find evaluates the command line as an expression, so putting -delete first will make find try to delete everything below the starting points you specified.

The use of the -delete action on the command line automatically turns on the -depth option. As in turn -depth makes -prune ineffective, the -delete action…


Sample Commands

List files, newest first
ls -lth

See commands currently using the internet
lsof -i -n

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

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

Read More

Blog entries:

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

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