Showing posts with label commands. Show all posts
Showing posts with label 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.

Saturday, August 27, 2011

The Unix System Architecture

An operating system(OS) is an intricately woven fabric of programs.The programs are usually coded in the assembly language and are  specific to the processor around which the computer is built. The unix OS ,on the contrary, is written largely in the 'C' language which is not processor dependent. However, part of the unix os is written on the Assembler. This makes Unix highly portable- which means that it can run on various processors with little modification.
The structure of the Unix OS makes it a better OS as compared to other conventional operating systems.

The responsibilities of an OS include command interpretation,I/O control, communications and a lot more .To perform these tasks a large number of simple as well as complicated programs are needed. These programs can be independent or interdependent. In conventional operating systems, all these programs are put  together forming one large program that occupies a large amount of memory. Therefore the system response is very slow. Unix with a fresh structural approach does not slow down the system.

The Unix system can be divided into four major units. These units work together but are still separate so that one large portion of the memory does not get blocked and slow the system down.
 
The four units are:-


1. Kernel- A core unit that interacts with the hardware for low-level functions. The kernel is  a program that constitutes the nucleus of the operating system. It co-ordinates the internal functions of the computer, such as allocating system resources. The kernel works invisibly. The user will never be aware of it while working on the system.


2.Shell- An outer unit that interacts with the user to perform functions desired by the user. The shell is a program that acts as a liason between the user  and the kernel by interpreting and executing user commands. As it reads user input and sends messages to the user it is described as interactive.

3.Commands - Commands  are compiled C programs that perform a specific operating system job. These commands are invoked by name through the shell. Unix has very few in- built commands(internal commands) like 'echo'and 'pwd'. For these no separate C compiled programs are required. These are the shell's inbuilt features and the  shell is able to interpret them itself. Unix commands  perform  a range of functions like editing, copying , erasing files, sending and receiving emails etc.

4.File System- The file system is a collection of all the files available on the computer. It allows you to store and retrieve information easily.