You are on page 1of 4

12/27/2017 UNIX / Linux : What Is a Shell? What are different Shells?

THE GEEK DIARY


UNIX / Linux : What Is a Shell? What are di⮰�erent Shells?
HOWTOS | BASICS | CONCEPTS

By Sandeep (https://www.thegeekdiary.com/author/sandeep_patil/)

What Is a Shell?
A shell is a program that provides an interface between a user and an operating system (OS) kernel. An OS starts
a shell for each user when the user logs in or opens a terminal or console window.

A kernel is a program that:

Controls all computer operations.


Coordinates all executing utilities
Ensures that executing utilities do not interfere with each other or consume all system resources.
Schedules and manages all system processes.

By interfacing with a kernel, a shell provides a way for a user to execute utilities and programs.

User Environment
The shell also provides a user environment that you can customize using initialization les. These les contain
settings for user environment characteristics, such as:

https://www.thegeekdiary.com/unix­linux­what­is­a­shell­what­are­different­shells/ 1/5
12/27/2017 UNIX / Linux : What Is a Shell? What are different Shells?

Search paths for nding commands.


Default permissions on new les.
Values for variables that other programs use.
Values that you can customize.

What are the di⮰�erent Shells?


The following sections describe OS shells mostly available on UNIX/Linux Operating system. Shell features and
their default prompts are also described.

1. The Bourne Shell


The Bourne shell (sh), written by Steve Bourne at AT&T Bell Labs, is the original UNIX shell. It is the preferred
shell for shell programming because of its compactness and speed. A Bourne shell drawback is that it lacks
features for interactive use, such as the ability to recall previous commands (history). The Bourne shell also lacks
built-in arithmetic and logical expression handling.

The Bourne shell is the Solaris OS default shell. It is the standard shell for Solaris system administration scripts.
For the Bourne shell the:

Command full-path name is /bin/sh and /sbin/sh.


Non-root user default prompt is $.
Root user default prompt is #.

2. The C Shell
The C shell (csh):

Is a UNIX enhancement written by Bill Joy at the University of California at Berkeley.


Incorporated features for interactive use, such as aliases and command history.
Includes convenient programming features, such as built-in arithmetic and a C-like expression syntax.

For the C shell the:

Command full-path name is /bin/csh.


Non-root user default prompt is hostname %.
Root user default prompt is hostname #.

3. The Korn Shell

The Korn shell (ksh):

Was written by David Korn at AT&T Bell Labs


Is a superset of the Bourne shell.

https://www.thegeekdiary.com/unix­linux­what­is­a­shell­what­are­different­shells/ 2/5
12/27/2017 UNIX / Linux : What Is a Shell? What are different Shells?

Supports everything in the Bourne shell.


Has interactive features comparable to those in the C shell.
Includes convenient programming features like built-in arithmetic and C-like arrays, functions, and
string-manipulation facilities.
Is faster than the C shell.
Runs scripts written for the Bourne shell.

For the Korn shell the:

Command full-path name is /bin/ksh.


Non-root user default prompt is $.
Root user default prompt is #.

4. The GNU Bourne-Again Shell


The GNU Bourne-Again shell (bash):

Is compatible to the Bourne shell.


Incorporates useful features from the Korn and C shells.
Has arrow keys that are automatically mapped for command recall and editing.

For the GNU Bourne-Again shell the:

Command full-path name is /bin/bash.


Default prompt for a non-root user is bash-x.xx$. (Where x.xx indicates the shell version number. For
example, bash-3.50$)
Root user default prompt is bash-x.xx#. (Where x.xx indicates the shell version number. For example,
bash-3.50$#)

Here is a short comparison of the all 4 shells and their properties.

Shell Path Default Prompt (non-root Default Prompt (Root


user) user)

The Bourne Shell (sh) /bin/sh and /sbin/sh $ #

The C Shell (csh) /bin/csh % #

The Korn Shell (ksh) /bin/ksh $ #

The GNU Bourne-Again Shell /bin/bash bash-x.xx$ bash-x.xx#


(Bash)

https://www.thegeekdiary.com/unix­linux­what­is­a­shell­what­are­different­shells/ 3/5
12/27/2017 UNIX / Linux : What Is a Shell? What are different Shells?

CHEAT SHEETS

LDOMs (OVM for SPARC) Command line reference (https://www.thegeekdiary.com/ldoms-ovm-for-sparc-command-line-


reference-cheat-sheet/)
Solaris Volume Manager (SVM) command line reference (https://www.thegeekdiary.com/solaris-volume-manager-svm-
command-line-reference-cheat-sheet/)

Solaris ZFS command line reference (https://www.thegeekdiary.com/solaris-zfs-command-line-reference-cheat-sheet/)


RHEL 7 – RHCSA Notes (Cheat Sheets) (https://www.thegeekdiary.com/rhel-7-rhcsa-notes-cheat-sheets/)
CentOS / RHEL 7 : rewalld Cheat Sheet (https://www.thegeekdiary.com/centos-rhel-7- rewalld-command-line-reference-
cheat-sheet/)
systemd command line reference (cheat sheet) (https://www.thegeekdiary.com/centos-rhel-7-systemd-command-line-
reference-cheat-sheet/)
SOLARIS INTERVIEW QUESTIONS

The ultimate Solaris Volume Manager (SVM) interview questions (https://www.thegeekdiary.com/the-ultimate-solaris-


volume-manager-svm-interview-questions/)
The ultimate Solaris zones (containers) interview questions (https://www.thegeekdiary.com/the-ultimate-solaris-zones-
containers-interview-questions/)
The ultimate Solaris networking interview questions (https://www.thegeekdiary.com/the-ultimate-solaris-networking-
interview-questions/)
The ultimate ZFS interview questions (https://www.thegeekdiary.com/the-ultimate-zfs-interview-questions/)
HARDWARE CHEATS

Most Commonly used ALOM commands (https://www.thegeekdiary.com/most-commonly-used-alom-commands-cheat-


sheet/)
Most Commonly used ILOM commands (https://www.thegeekdiary.com/most-commonly-used-ilom-commands-cheat-
sheet/)

Most Commonly used LOM commands (https://www.thegeekdiary.com/most-commonly-used-lom-commands-cheat-


sheet/)
Most commonly used XSCF commands (https://www.thegeekdiary.com/most-commonly-used-xscf-commands-cheat-sheet/)

Most Commonly used RSC commands (https://www.thegeekdiary.com/most-commonly-used-rsc-commands-cheat-sheet/)


How to login into console from ILOM, ALOM, LOM, ELOM, XSCF, RSC (https://www.thegeekdiary.com/how-to-login-into-
console-from-ilom-alom-lom-elom-xscf-rsc/)

https://www.thegeekdiary.com/unix­linux­what­is­a­shell­what­are­different­shells/ 4/5

You might also like