Friday, December 26, 2014

Introduction to the shell

The command interpreter is the interface between the user and the operating system, hence the name "shell".

The shell, a shell between the OS and the userThe shell therefore acts as an intermediary between the operating system and the user thanks to command lines that are entered by the latter. Its role consists in reading the command line, interpreting its meaning, carry out the command, and then return the result via the outputs.

The shell is an executable file responsible for interpreting the commands, transmitting them to the system, and returning the result. Ther are several shells, the most common being sh (called "Bourne shell"), bash ("Bourne again shell"), csh ("C Shell"), Tcsh ("Tenex C shell"), ksh ("Korn shell"),and zsh ("Zero shell"). Their name generally matches the name of the executable.





Shell Name
Developed by
Where
Remark
BASH ( Bourne-Again SHell )Brian Fox and Chet RameyFree Software FoundationMost common shell in Linux. It's Freeware shell.
CSH (C SHell)Bill JoyUniversity of California (For BSD)The C shell's syntax and usage are very similar to
the C programming language.
KSH (Korn SHell) David Korn AT & T Bell Labs
--
TCSHSee the man page.
Type $ man tcsh
--
TCSH is an enhanced but completely compatible version of the Berkeley UNIX C shell (CSH).

                 Each user has a default shell, which will be launched upon opening of a command prompt. The default shell is specified in the dans configuration file /etc/passwd in the last field of the line corresponding to the user. It is possible to change the shell during a session by simply executing the corresponding executable file, for example:/bin/bash
 
Tip: To find all available shells in your system type following command:
$ cat /etc/shells

Prompt
      The shell is initialized by reading its overall configuration (in a file of the directory /etc/), followed by reading the user's own configuration (in a hidden file whose name starts with a dot, located in the basic user directory, i.e. /home/user_name/.configuration_file). Then, a prompt is displayed as follows: 

machine:/directory/current$
 
By default, for most shells, the prompt consists of the name of the machine, followed by two points (:), the current directory, then a character indicating the type of user connected:
  • "$" speciies a normal user
  • "#" specifies the administrator, called "root"


No comments:

Post a Comment