Wednesday 15 March 2017

Command Line - Man Pages


You might have read my previous posts on Linux System and now we are going to start with some real commands used in the command line of Linux. As you are just new with the Linux commands, I would prefer starting with the Linux man command.

First of all, a question that strikes to your mind must be : Why starting with this command? ; and the other question is very common : What does this command do? The answer to both these questions are inter-related.

Let me take an example. Suppose that you brought some new electronic gadget. You may see many buttons on that gadget but you don't know how to use them. So, what will you do? Obviously, you will read the user manual provided with that gadget which will guide you through steps on how to use the device.

Similarly, man in Linux is similar to user manual. It helps us to learn using different commands on Linux. Man Pages are the short form of Manual Pages. Most Unix files and commands have pretty good man pages to explain their use. Man pages also come in handy when you are using multiple flavours of Unix or several Linux distributions since options and parameters sometimes vary.

When you use the man command to access a manual to some particular keyword, the manual that you see on your screen seems somewhat hard to understand. However, users typically find them to be increasingly useful as they become more familiar with them and gain experience in the use of Unix-like operating systems.

The man command itself is very easy to use. The syntax of man command is :
man [option(s)] keyword(s)

man is most commonly used without any options and with only one keyword. The keyword is the exact name of the command or other item for which information is desired.

For example, the following provides information about the ls command (which is used to list the contents of any specified directory):
man ls

 As another example, the following displays the manual guide (man page) about the man pages:
man man

Man Sections :

Each man page is a self-contained article that is divided into a number of sections, the headers for which are labeled with upper case letters. The sections for commands are typically something like NAME, SYNOPSIS, DESCRIPTION, OPTIONS, AUTHOR, BUGS, COPYRIGHT, HISTORY and SEE ALSO, although there may be some differences according to the particular command. Some of these might be broken down into subsections, particularly OPTIONS in the case of a command that has numerous options. 

The manual writes a colon at the bottom of the screen to indicate the end of the on-screen page. The user can move to the next page by pushing the space bar and can return to the previous page by pressing the b key. Pressing the q exits the man pages and returns the user to the shell program.

There are many different types of commands, files, functions, system processes, etc. for which a user manual is required for understanding the things. On the other hand, man is a single command which provides a manual for all these. Hence, proper sub-divisions of these data became important.

The man pages as a whole are organized into sections, each containing pages about a specific category of topics as shown below. The section to which an article belongs is indicted in parenthesis in the top line, before the NAME header.
1. executable programs or shell commands
2. system calls
3. library routines
4. special files (i.e., devices in the /dev directory)
5. file formats
6. games
7. macro packages
8. system administration commands
9. kernel routines
n. Tcl/Tk (a programming language)

Some topic names will have multiple articles, depending on context. For instance, there are two articles for mount, one corresponding to its use as a command in system management (i.e., to logically attach partition or other devices to the main filesystem) and the other for use in the C programming language. Generally, the most commonly used topic is displayed by default, and there are references to any other topics with the same name in the SEE ALSO section at the bottom of the final on-screen page.

The syntax to specify an article from a particular section is:
man section_number keyword
Thus, for example, the following would display the article about mount from Section 2 instead of from the default Section 8:
man 2 mount

Commands similar to/used with man :

There are many commands which are used along with man command, or they perform a task which can also be performed by man command. Some of them are explained below :

whatis :

To see just the description of a manual page, use whatis followed by a string. For example, whatis route shows the description of route command. The syntax is :
whatis string

For example,
whatis route

whereis :

You can find the location of a man page for a particular command, file or keyword in general. The location of a manpage can be revealed with whereis. The syntax is :
whereis -m keyword(s)
Here, -m is an argument which refers to manual. One can interpret the syntax as : where is the manual for the given keyword.

For example,
where -m ls
This will provide you the location of manual of ls command.

Unix-like operating systems often also have an additional built-in manual referred to as the Info documents, the content of which is largely identical to that of the man pages. These documents can be accessed with the info command.


For a reason that I have to maintain size of my article, I cannot provide you with screenshots of each and every command. So better try to run the commands by yourself and if any queries, kindly comment your queries below.

1 comment:

  1. CONTACT: onlineghosthacker247 @gmail. com
    -Find Out If Your Husband/Wife or Boyfriend/Girlfriend Is Cheating On You
    -Let them Help You Hack Any Website Or Database
    -Hack Into Any University Portal; To Change Your Grades Or Upgrade Any Personal Information/Examination Questions
    -Hack Email; Mobile Phones; Whatsapp; Text Messages; Call Logs; Facebook And Other Social Media Accounts
    -And All Related Services
    - let them help you in recovery any lost fund scam from you
    onlineghosthacker Will Get The Job Done For You
    onlineghosthacker247 @gmail. com
    TESTED AND TRUSTED!

    ReplyDelete

Thanks for reading this article.
Please comment your reviews..This will help us improve.

Popular Posts