Man Command

Man Command

The first, and most useful, thing to learn on the journey to the RHCSA is the man command.

Almost every command-line tool in Linux has easily accessible documentation. These documents are known as man pages and they are accessed using the man command.

Once you've learned how to use man , then you can find the commands needed to do most of the things that you would want to do in Linux.

At its most basic usage, when you already know which command you want to see the documentation of, the syntax is:

man [command/tool name]

Man pages are divided into many sections:

  1. Executable programs or shell commands
  2. System calls (functions provided by the kernel)
  3. Library calls (functions within program libraries)
  4. Special files (usually found in /dev)
  5. File formats and conventions eg /etc/passwd
  6. Games
  7. Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
  8. System administration commands (usually only for root)
  9. Kernel routines

The same entry name can be found in many sections. It can be helpful to specify the section number.

man [section-name] [command/tool name]

For example

man 3 printf

If you're not getting the results you expect when looking up a command using man, you can use the command line option 'f' to list all man pages that match the name in the input.

For example

man -f printf

Or, you can also view all man pages for a given input one by one using the 'a' command-line option. The man pages will display in order of the section that they appear in.

For example

man -a printf

If you're not sure what the command that you want is, you can try using the search command line option 'k'. This will search the command name and short description for the text or regular expression used.

For example

man -k printf

There are many more command-line options that can be used with man, but these are some of the most useful. These commands should enable you to find help for almost most things that you want to do.