man Command

“man” command is a very useful command of Unix. It’s abbreviation of “manual”. Actually in Unix man command used to display the manual of any command. In Unix every command has independent existence and file of every command stored in certain directory. These files contains programs which are written in C. So after running this command it will display all the information about particular command.

“man” command display the manual page which is divided into a number of compulsory and optional sections. Every command does not have all the sections but the first three sections generally come in all man pages. These sections are-

  • Name
  • Synopsis
  • Description

Name:- Name section contains one line introduction about the command. It displays the what is the command and what is the use of it?

Synopsis:- This section shows the syntax and arguments used by the command. It tells that characteristic of command and how it will be used.

Description:- Description is nothing but details description of particular command. Often it is the largest section of any command.

The Synopsis section has some convention and rules which is useful for every users like

  • If command argument is closed with the rectangular brackets then it’s not required arguments, otherwise argument is not required.
  • A set of three dots (chap…) indicates that there can be more arguments of the preceding word.
  • The pipe | indicates that only one of the options shown on the either side of pipe can be used.

There are also some other sections like Options, Operands, Usage, Exit Status and etc.

Maybe it will be useful for beginner but I have post it only for my knowledge base.


Vi Editor

While running through Unix I felt that Vi editor is the very powerful editor in comparison to others and have capability to handle any type of file. It’s same as any other text editor but having some powerful features. Vi editor is written by Bill Joy in 1976 for BSD system. It comes with every Unix system. Vi editor is very and first step to learn Shell Script, generally we write our script in same. To find the Vi editor in Unix, you just go through terminal (In windows, we call it Command Prompt but in Unix we call it Terminal) and type Vi and hit enter. It will open the Vi editor. It is having 3 main modes

  • Command Mode
  • Input Mode
  • Last Line Mode

The default mode of Vi editor which accept any text as a command called as Command Mode. To come in Input mode from command mode you should press “i” key first. It will change Vi command mode to Input mode. Every key pressed after switching to Input mode actually shows up as text. We are writing shell script in Input mode. We used Esc key to take this mode to Command Mode. Last line mode is used to handle files like for saving and perform substitution. Pressing a colon (:) in the Command Mode invokes this mode.

This is the very basic things about Vi editor but I think it is also useful for beginner. Here you can find some useful command of VI editor