Tuesday, September 13, 2011

Shell Commands

A program is a set of instructions to the computer.Programs that can be executed by the computer without need for translation are called Executable Programs or Commands.
As a user of the unix system ,there are many standard programs and tools available to you.
You can also employ system calls, subroutines etc. to write programs and develop software on unix. 

The syntax of  a unix system command line is:

          command option(s) arguments

 Command is the name of the program you want to run.

Options or Flags modify how a command runs.Flags are generally one letter codes preceeded by a '-' sign,'+' sign or by no character.

Parameters or Arguments specify data that the command processes,usually the name of a directory or file.
Space separates commands and arguments and arguments among themselves.If arguments need to have spaces and yet be treated as one argument, these must be enclosed in double quotes(") or single quotes(').

Each new command has to be entered after command line separators  which are a semicolon enter key and an ampersand(&).

Unix handles user commands through a COMMAND INTERPRETER. Command Interpreter  is  a special interface program that processes commands entered at the keyboard. After you log in a command prompt( a symbol that indicates that the interpreter is ready for the command to be entered) will be shown which may look like 
machine %

where 'machine' is the name of that particular unix system. The command prompt may be different as there are three command interpreters- the C shell, the Bourne shell and the Korn  shell.

To execute a command,enter  a command line when a prompt (such as a $ sign) appears on the screen. The shell considers your command as input, searches through one or more directories to retrieve the program you specifiedand conveys your request along with the program requested  to the kernel.The kernel then follows the instructions in the program and executes the command you requested.

After the program has finished running the shell signals that it is ready for your next command by printing another prompt.