It is kind of easy to get lost in the realm of Linux commands. It is not easy to memorize hundreds of commands and thousands of options and arguments.
Here in this post I am going to list some of the possible ways that can help with getting documentation and usage examples for whichever command you are looking for.
man
man
is the system manual pager that you can give an argument that represents a command, utility or a function and it should represent its documentation for you.
Usage example
man wget
Running the command above will print out to the console a full description of the wget
command (which is by the way, a program that can download files from the internet and it supports multiple protocols) along with all the available options and arguments.
If man
doesn't exist in your system, you can use sudo apt install man-db
to be able to use it in your distro if it supports apt package manager.
info
info
is a software utility that presents infotext documentation as an easy to travers tree that you can go through.
Usage example
info wget
This will print out the the console textinfo documentation about wget
command.
You can also navigate to a specific section in the documentation by specifing it as an argument
info wget examples
Will take you directly to the examples section of wget documentation.
usr/share/doc
Most application will have a readme file that you can open in the directory usr/share/doc
--help
Will show you usage guide for almost any command. They maybe simplified but you can pipe them through less
to read at your own speed.
Top comments (1)
I am voting for --help flag. Wait... this isn't a poll.
From my own experience, if you can't find the answer to your question from what --help returns, you are staring at spending considerable time researching that tool with questionable return. Time you might consider actually spending on writing some script yourself to achieve the same result. Text processing utilities are prime candidates for this approach. Might as well bang out a sed or awk script instead of digging through the man pages of various specialized text utilities that may not return what you expected them to.
In lieu of scripting yourself out of the man page abyss, you could sharpen your man and info pages search skills and some basic regular expressions knowledge. While reading a man page, type / and some regular expression to sift through possible answers.