This post explains the term Terminal, Shell and Bash used in Linux. After reading this post you should be able to distinguish between these conmanly related terms.
Terminal
Terminal is a program called a terminal emulator. It opens a window and lets you interact with the shell. Various types of terminal emulators are supported by Linux distributions. Some of them are gnome-terminal, konsole, rxvt, kvt, nxterm, and eterm.
A terminal window has shell prompt that contains user name followed by the name of the machine. For example
Shell
A Shell is a command line interface (CLI) between a users and the kernel. It is a program that takes commands from the keyboard and gives them to the operating system to perform. Shell in Linux can be used to run programs, work with file systems and so on. It actually processes commands and returns output.
On most Linux systems a program called bash (which stands for Bourne Again Shell) acts as the shell program. Besides bash, other shell programs available for Linux systems include: ksh, tcsh and zsh.
Bash
Bash is largely compatible with sh and incorporates useful features from the Korn shell and the C shell. Bash is quite portable, independently-supported ports exist for MS-DOS, OS/2, and Windows platforms. C shell has interface similar to the C language.
Example
Following command will display what shell the terminal opened with. In the below example, $SHELL
is environment variable.
root@tryit-evolving:~#echo $SHELL /bin/bash
Below command find out what shell you are currently in
root@tryit-evolving:~# ps -p $$ PID TTY TIME CMD 144 pts/0 00:00:00 bash
Above shows that the shell is bash. Bellow example illustrate how to find the name of the current.
root@tryit-evolving:~# echo $0 bash