Understanding Linux Manual (man) Pages
Man pages are the work of various people doing their best to describe the commands and their usage. Man pages come from different sources and most are similar but not all. Manual pages were generally written by the persons who wrote the program themselves. They are descriptive enough but it's not a full documentation. Man pages themselves are broken up into several parts, indicated and organized by heading terms. Most heading terms you will see in man pages are common across different man pages, and will be presented in the same order in each case.
Man pages are the most reliable command for getting help. Man pages are not easy to understand in starting, but when you start reading man pages you will get familiar with it. If you are in doubt how the commands work you can just simply type man command. For getting help how to read man pages you can also type command man man for man page help.
Different headings in man pages
For man pages of ls
$ man ls
LS(1)
User Commands
LS(1)
NAME
ls - list directory contents
SYNOPSIS
ls [OPTION]... [FILE]...
DESCRIPTION
List information about the FILEs (the current directory by
default). Sort entries alphabetically if none of -cftuSUX
nor --sort.
-a, --all
do not hide entries starting with .
-A, --almost-all
do not list implied . and ..
-b, --escape
print octal escapes for nongraphic characters
--block-size=SIZE
use SIZE-byte blocks
-B, --ignore-backups
do not list implied entries ending with ~
-c with -lt: sort by, and show,
ctime (time of last
modification of file status information)
with -l: show ctime and sort by name otherwise:
sort by ctime
----
----
----
----
-X sort alphabetically by entry extension -1 list one file per line --help display this help and exit --version output version information and exit By default, color is not used to distinguish types of files. That is equivalent to using --color=none. Using the --color option without the optional WHEN argument is equivalent to using --color=always. With --color=auto, color codes are output only if standard output is con nected to a terminal (tty). AUTHOR Written by Richard Stallman and David MacKenzie. REPORTING BUGS Report bugs to <bug-fileutils@gnu.org>. COPYRIGHT Copyright © 1999 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SEE ALSO The full documentation for ls is maintained as a Texinfo manual. If the info and ls programs are properly installed at your site, the command info ls should give you access to the complete manual. |
The different headings are described below
ls (1)
It shows the command that you search. 1 indicates the section you have searched. Man pages have different sections.
Man page sections are:
(1) User Commands
(2) System Calls
(3) Library functions
(4) Devices
(5) File formats
(6) Games and Amusements
(7) Conventions and Miscellany
(8) System Administration and Priveledged Commands
(L) Local. Some programs install their man pages into this section instead of (1)
(N) TCL commands
For different sections man pages you can use the command
$ man k ls
Or
$ man –k ls
Where k is the section as described above.
NAME
The name of the command and a brief description.
SYNOPSIS
This describes the various flags and the proper format the command require. The synopsis is shown using the command followed by [OPTION]... [FILE]...
The "OPTIONS" in Brackets “[ ]” indicates that this is not necessary, but it can be used.
It is followed by a "..." means this can be used one or more times.
So now let’s analyze the above synopsys
ls [OPTION]... [FILE]...
Here ls command after that option in bracket then … then file in bracket then …
Means option and file are not necessary but can be used and many option and file can be there
Here are some examples
ls
no option no file only ls can be used it list all files in the present directory
ls –l
One option but no file. It lists the files in present directory in detail description of files.
ls -l /home
One option and one file. It lists the detail of files in home directory.
ls -al /home or ls -a-l /home
Here two options and one file.
It is the detail description of the Synopsis heading. If you understand it then you get almost all about using the command.
DESCRIPTION
A detailed description of what the command will do. It highlights specific functions of the command mentioned and also provides the OPTIONs available for the command.
OPTIONs are preceded by hyphens.
You can either specify them individually with a space in between them as (ls -a -l)
It can also be used together as ( ls -al).
You can use -a or --all as ls -a or ls --all both gives same result
AUTHORS
The people who has created and assisted in the creation of the command.
REPORTING BUGS
If you find any problems with the command, this tells you where you should report the defects or problems you are having with the command.
COPYRIGHT
The person or organization that holds the copyright to this information.
SEE ALSO
Other commands that are related to this command.
No comments:
Post a Comment