Showing posts with label unix commands. Show all posts
Showing posts with label unix commands. Show all posts

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 
%
or
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.

Tuesday, August 30, 2011

Basics of Unix Commands

Unix is a command line based operating system. Unix commands can be combined to perform complex tasks.To perform these tasks repeatedly these commands can be placed in files called shell scripts and these shell scripts can be executed to provide the required output.

Unix users and processes:


Unix has two basic concepts : files have places and processes have life . All files are placed at some location and each process travels  in a life cycle from birth to death.


Each user in unix is identified by uniquely by an  identification number,name and group identification.A user is able to access  a unix system only after being given a login name and password by the system administrator. When a user tries to access a unix system it displays a  login  prompt where the users types in the login name and password. If the user is a valid user , a shell prompt($) appears on the screen where unix commands can be typed..


A user can end a unix session by pressing < ctrl+d >.  Ctrl+d kills a process.


Command Line is defined as the line on which the shell prompt occurs and a command with its arguments is  entered  and is considered complete only when the enter key is pressed.
The command may spill over multiple lines shown by a secondary prompt (>). The complete line is then fed to the shell as its input for interpretation and execution.


Unix is CASE SENSITIVE. All unix commands must be typed in LOWER CASE.


The next post would be concerning shell commands- the syntax and the  actual commands.