Sometimes, you're going to need
further assistance with the syntax and the different options
for a Linux command that you're using in the Shell.
In this video, you're going to learn how to get the help
you need from within the Shell itself,
using something known as a man page.
No matter what your experience, level or role is,
documentation can help users of Linux
perform a wide variety of activities,
and resolve a wide range of issues.
Because there is no official form of Linux
or single authoritative source of documentation,
you're going to find that documentation
is spread across multiple sources,
including manual pages, built-in help commands,
online documentation projects, Usenet news groups,
internet mailing lists, Q&A websites,
forums and social media, as well as books
and other print resources.
Now, the first one and the most important one
for you to look at is the man pages.
The man pages are available on Linux systems by default,
and they contain a complete documentation
that's specific to each Linux command,
and it's going to be displayed using the man command
from within the command line interface or the Shell.
They usually include information
such as the name of the command,
its syntax, a description of its purpose,
the options it supports, examples of common usage
of the command, and a list of related commands.
Man pages are perhaps the most immediate source of help
available to you, because they're right there
at your fingertips whenever you need to learn more
about a command and what it does or how it operates.
But it can be difficult for somebody who's not familiar
with the formatting of a man page to actually read them.
So, let's talk a little bit
about the different parts of a man page.
Now, the first part is the synopsis.
The synopsis is the part of the man page
that provides the syntax of the command,
along with some example use cases.
For example, when you see bold text, this means something
you would type in exactly as shown into the CLI.
Italic text, on the other hand, should be replaced
with the appropriate argument,
and this may be formatted differently on certain systems,
like an underlying text or a colored text,
depending on your Linux distribution.
Next, we have a part that looks like -abc,
and this indicates that all the arguments
within those brackets are going to be optional.
If you see two arguments separated by a pipe,
like -a|-b, this indicates that the arguments
on the other side of the pipe cannot be used together.
This is an "either or" argument pair
that you have to pick between.
If you see any italics text with an ellipsis, like "..."
after it, this indicates that the argument can be repeated,
and you can have multiple sets of arguments.
The man command also supports different options,
such as -a, -D, -f, -h, -k, -K, -t.
If you type -a, you're going to find
all the entries matching your query.
If you type -D, you're going to be displaying
the debugging information.
If you type in -f this will display
a short description of the command,
along with the man pages.
If you use the -h command,
this is going to display help options
for the man command itself.
If you type -k,
you're going to get a list of all the manuals
and pages and sections that contain the keywords,
along with their location.
If you use the -K, you're going to search
for the specified string on all of the pages.
By typing a -t, the man pages will be formatted
so they can be printed out.
As you're probably already seeing,
man pages can become really complicated, but really useful.
When you look at man page sections,
these are going to define what category the command belongs to.
When a command has more than one section listed,
it means the documentation for the same command
is available for more than one source.
These sections are identified
by the number displayed beside the command.
For example, the command fsck is used to check
and repair the Linux file system.
If you search for fsck in the man pages,
you're going to see fsck(8) displayed.
This indicates which of the eight sections
or categories of man pages
this particular command is assigned to.
Section one contains general commands.
Section two contains system calls.
Section three contains C library functions.
Section four contains special files.
Section five contains file formats and conventions.
Section six contains games and screen savers.
Section seven contains miscellaneous.
And lastly, section eight contains system
administration commands and daemons.
There's also going to be special keys
that can be used to navigate
the Linux man pages on your keyboard.
If you use the Home key,
this moves the cursor to beginning of the man page.
And if you press the End key,
it moves you all the way to the end of that man page.
By pressing Page Up or Page Down,
you'll scroll either up one or down one page at a time.
If you press the forward slash key,
this will begin a new search for a term or text string.
If you press the End key, this will move
to the next occurrence of that search term.
And if you press P, it'll move you
to the previous occurrence of that search term.
Finally, when you're done reviewing the man page,
you can press Q to quit,
and then you'll be returned back to the Shell prompt.
As I said, using man pages is really helpful.
I do recommend that you play around
with the man command a little bit on your Cent OS system,
so you get more comfortable using it on a daily basis.