What is Shell in Unix/Linux?
|Post Contents
Introduction
While learning UNIX / Linux Shell, I think a lot about what exactly Shell is. So, I decided to read more about it, to make it clear understanding. Many of us often confused like this.
In Unix, the shell is a program that read commands and acts as an intermediary between the user and the inner workings of the operating system.
Providing a command-line interface (i.e., the shell prompt or command prompt), the shell is analogous to DOS and serves a purpose similar to graphical interfaces like Windows, Mac OS X.
What is shell in Unix / Linux ?
Users use commands to direct the operation of the computer or create text scripts with such one or more commands that execute one by one. Users interact with Unix Shell using a terminal emulator.
4 important concepts in shells
1 – User interact with the system using the shell
2- A sequence of operations can be scripted by placing the operations in a script file.
3- Shell is a featured programming language with variables, conditional statement etc.
4- Shell allows to create a Linux/UNIX program like another Linux/UNIX program with all privileges.
In UNIX systems, there are many shells available. For general users, they look same but each has different syntax and properties. 2 Major shells are –
Bourne Shell
Bourne shell means sh written by Stephen Bourne at AT&T as Unix command-line interpreter. It introduced with features like piping, command substitution, variable, control structure for component testing etc.
C Shell
C Shell means csh was written by Bill joy. It also introduced with a large number of features like history, editing, tlide, aliases, notation, cdpath, path hashing etc.
The Bourne shell was the first shell to appear on the UNIX OS so it’s referred to as the shell. Bourne shell is usually installed as /bin/sh on most versions of UNIX. For this reason, it is the shell of choice for writing scripts to use on several different versions of UNIX.
Again, Bourne shell sub-categorize in following
- Bourne shell ( sh)
- Korn shell ( ksh)
- Bourne Again shell ( bash)
- POSIX shell ( sh)
The different C-type shells follow:
- C shell ( csh)
- TENEX/TOPS C shell ( tcsh)
Hope this tutorial will help to understand the basics of what is shell in unix/linux, if you would like to learn more then please visit below “Hello World” tutorial.