Administering Networking OS — Getting Help (CLI) #5
College Online Material
Published in
3 min readMar 16, 2021
Introduction to Man Command
Man Pages
- Man pages are usually available for commands, functions, or files
- Man pages are available on the local system
$ man [options]
$ man file
Controlling The Man Page Display
- The man page will be displayed by a pager program, either less or more (less is usually used)
h
to view help |spacebar
to move forward |/
to start a search |q
to quit
Man Pages Section
- The word sections have two important meanings for man pages.
- Each man page is broken down under different section heading like name, synopsis, and description
Searching Within a Man Page
- To initiate a search type
/
- Press
enter
to view the first match - Press
n
to view the next match - Press
N
to view the previous match
Searching The Sections
- To match man pages that have names and a term, you can use the man command with the -f option
$ man -f passwd
- The man command has an option,
-k
, which takes a keyword as an argument - Executing
man -k
keyword will search all the man pages descriptions for the keyword
Using The Info Command
Info Command
- The info command provides documentation of commands and files similar to the man command
Displaying Info Documentation for a Command
- Press
h
to get help on using the info
Moving Around WHile Viewing an Info Document
Exploring Info Documentation
- Unlike man pages that are sometimes not very easy to read, the info pages are designed to be readable by regular people
- Consider executing simply info to begin the available info documentation
- You may also want to try using
pinfo
, a more colorful and easier to use version of info
Getting Additional Help
The standard GNU option for documentation is — help
. Use to display basic command usage, which is similar to the man page.
Finding Commands and Documentation
The whereis
command will display the location of a command executable, as well as its source and documentation, if available.
Find Any File or Directory
The locate command is able to find the file as long as the user has permission to access the containing directory by searching a database of filenames on the system
The Locate Command
- The
locate
command will match any part of a filename, solocate readme
could match a file namedabcreadme123
- The
-b
option for locating allows for abasename
search, e.g.:locate -b readme
- The -c option provides a count of the number of matching files:
locate -c readme