3

I know about Linux terminal. I can also issue many advanced commands over terminal. But one simple concept is not clear to me.

What is terminal and how does it work?

I know about hardware which consists of CPU, RAM, HARD DISK and so on.

I know about kernel which is basically the core of the operating system.

I know about software which sits on the top of kernel.

And I know about users.

And I know that user uses either terminal or GUI to give instructions to the software.(or kernel?)

Now please explain these concepts of terminal and shell.

Graphical explanation and simple non-technical words are preferable.

rancho
  • 649
  • 2
  • 8
  • 14

2 Answers2

5

What is shell?

In simple words, shell is a software which takes the command from your keyboard and passes it to the OS.

So are konsole, xterm or gnome-terminals shells?

No, they're called terminal emulators. They open a GUI to interact with the shell. You can think of them as a frontend to the shells.

shell reference

Different Shells

There are different shells which are more or less same but the features and syntaxes are different.

Bourne shell The most basic shell available on all UNIX systems

Korn Shell Based on the Bourne shell with enhancements

C Shell Similar to the C programming language in syntax

Bash Shell Bourne Again Shell combines the advantages of the Korn Shell and the C Shell. The default on most Linux distributions.

tcsh Similar to the C Shell

  • But where is terminal in your diagram? What do you mean by "frontend to the shells " – rancho Jun 11 '16 at 16:38
  • Terminals are just the text input/output environment. And "Frontend to the shells" means they lie between the user and the shellls to provide a GUI environment. – Aniket Bhattacharyea Jun 11 '16 at 16:47
  • Then terminal should also lie between user and shells to provide a CLI enviroment? – rancho Jun 11 '16 at 16:49
  • No they don't lie between users and shells. They lie between kernel and Applications. Terminal is basically a peripheral device to interact with the machine. The shells are just softwares which are being run in a terminal. Even the GUI in the machine runs in a terminal. – Aniket Bhattacharyea Jun 11 '16 at 17:02
  • I basically get that OS is the kernel, CPU, RAM and others is the hardware, shell is the low lying software on which there are other softwares.And user access these software. Next all things are confusing. Terminal is a peripheral device to interact with the machine. Interact with what? Software, shell or kernel? And why GUI then can also not be called peripheral device to interact with the machine? – rancho Jun 11 '16 at 17:17
  • 2
    No, the shell is not the low-lying software on top of which other software runs: that is the kernel. The kernel interacts or permits interaction with the hardware. The peripherals are hardware devices that interface the computer with other things. A terminal is a peripheral that interfaces with a human, it is composed of output and input, of a screen and a keyboard. The GUI shows you a virtual terminal. The shell is the command-line interface software that is usually what a terminal is running. – Law29 Jun 11 '16 at 17:44
  • Hardly any Unix or Unix-like still has a Bourne shell nowadays. – Stéphane Chazelas Jun 11 '16 at 22:18
  • @Law29 You are the best – rancho Jun 11 '16 at 22:58
  • @rancho Thank you (but I fail to see why you removed your accept of my answer, then . . .) – Law29 Jun 12 '16 at 08:33
  • @Law29 It is because your original answer is too technical and difficult to grasp. A diagram is much more preferrable. – rancho Jun 12 '16 at 09:19
  • shell is a software which takes the command from your keyboard and passes it to the OS, this would imply that basically every program using any i/o is a shell. Would you mind refining your answer on this? – Elliott Sep 17 '21 at 13:13
1

The shell is the program that runs in the terminal, that reads the commands you type and executes them.

Unix and Unix-like operating systems today offer a choice between mostly the same set of shells, because these shells pre-date most of those operating systems.

For further reading I recommend Evolution of shells in Linux (IBM)

Edit to add information regarding shells and terminals following comments on another answer:

A terminal is a hardware peripheral that interfaces with a human, it is composed of output to the user and input from the user, in other words of a screen and a keyboard, see link. What the GUI shows you is a virtual terminal. The shell is the command-line interface software that is usually what you see on a terminal, but it doesn't have to be a shell. You could start up a virtual terminal and tell it to run vi directly, for example, no shell involved.

Law29
  • 1,156
  • 1
    Also find out what is Linux: it is just a kernel. It is not the operating system, though often (most of the time), people use this word to refer to some operating systems that (sometimes) use this kernel. This leads to a lot of ambiguity and confusion. ((Android uses the linux kernel, but is not like debian, ubuntu, suse, redhat, slackware, etc. debian can use other kernels, and cygwin that is also like these runs on Microsoft's windows.)) – ctrl-alt-delor Jun 11 '16 at 19:46