Linux Shell Environment

What is a Shell?

The term "shell" sometimes confuses beginners. When referred to by Linux users, the term "shell" means using the command line interface. It is important to know that using a shell is similar to use the DOS prompt. Linux also has a GUI (Graphical User Interface - pronounced gew-eee that is similar to Windows. Using the shell is often frustrating for beginners because you must know the commands, what they do, and the proper way to enter them. This means using the correct syntax. The Linux OS is controlled by the kernel, which is the heart of entire system. However, the kernel can only understand machine code. This is why a shell must be used. The shell interprets commands given by the user and translates them into machine code that the kernel can understand.

Types of Shells

There are several different types of shells available. Each shell has its own pro's and con's, but each shell can perform the same basic tasks. The main difference between them is the prompt, and how they interpret commands. The table below shows the most common shells and their attributes.

Shell Name

Ash

Bourne

Bash (Bourne Again)

Korn

C-shell

T-shell

Zsh

Author

Kenneth Almquist

Brian Fox/Chet Ramey

Eric Gisin

William Joy

Paul Falstad

Binary

ash

sh

bash

ksh

csh

tcsh

zsh

Default Prompt

$

$

$

%

%

The most common shell used by default on Linux systems is bash. In bash, the default prompt for a user is a $ sign. Unless you are logged in as root in which case it the # sign. As you can see by the output below, the root (administrator) is logged in and the # sign is displayed [which I have labeled red].

Switching Shells

Upon installation, you are prompted as to what shells you want installed. You can also specify a shell for each user. Let's say that weaponx wants to switch from the bash shell (bash) to the bourne shell (sh). Notice the output below:

[weaponx@roswell weaponx]$ sh
sh-2.05b$

Now that weaponx is using the boune shell, lets see how this shell interprets the long listing command.

sh-2.05b$ ll
sh: ll: command not found
sh-2.05b$

Ah, it didn't work! If we use the same command in the bourne again shell (bash), we get a different output.

That is just a simple example of how different shells handle commands. Note that some shells will not perform certain extended commands.
Using bash is your best bet. It is the most common, and rather easy to learn once you get the hang of it. If you would like to see a list of common bash commands click here.

Contact Us

If you found this information useful, click the +1 button

Your E-mail:

Subject:

Type verification image:

Message:

NOTE: this form DOES NOT e-mail this article, it sends feedback to the author.