# Getting Help
The immense power of the command line is accompanied by an astonishing amount of complexity. This chapter will point you at some resources available within the system itself to help you navigate this complexity.
# Man Pages
Man pages short for manual pages will provide you with a basic overview of a command, its options and features.
TIP
Try it out by checking what man
has to say about itself.
# Info
While man pages are a great source of information they do have some shortcomings
. For example there is no easy way to navigate between man pages. info
provides structured documentation based on topics rather then commands. Info
style documentation is usually more suited to learning a topic while man pages
often offer a more in-depth view of commands and features.
TIP
Try info
on its own and with a command as argument.
# Other sources of help
# The --help option
Most commands come with a built in help. Often this help can be viewed by
calling the command with the --help
or -h
flag.
TIP
Give it a try . Call ps --help
# Third party documentation
Most distribution have a dedicated location for third party vendors to store
documentation for their software. Typical places include /usr/share/doc
and
/usr/doc
. Refer to the documentation of your distribution for this path.
# Finding commands and documentation
# whatis
TIP
whatis
is a command that, well use it to find out what it does.
TIP
Now try whatis
on ls
.
You will see that there seem to be multiple commands that list directory content. Why? Long story short because their are two major UNIX variants and most Linux distributions contain the commands of both.
But now we have an issue. Which one of these is actually executed? Let's explore this.
# whereis
TIP
Use whereis
to figure out where ls
keeps its binaries sources and man pages.
Note that there usually is only one binary but two man pages here. This is
because ls
can be used with the details laid out by either of the man pages.
Sadly this is often not the case.
# locate
locate
can be used to find any file or directory. It uses a pre-generated
database which contains all files and directories present on the system at time
of database generation. Generation of this database is typically done once a
day. With root privileges you can update the locate
database using the
updatedb
command. Be aware that locate is not present in all distributions
by default.