What exactly is terminal? What is shell?

10,032

Solution 1

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

Solution 2

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.

Share:
10,032

Related videos on Youtube

rancho
Author by

rancho

I am an web developer by profession. I live two lives. One in which I go out, do my work, eat, drink, gossip, meet friends, relatives and so on. In my other life I have numerous pseudo names, fake email and active in various sites. I do programming both for profession and passion. Among the popular social networking tools I only use whatsapp. I rarely use facebook.

Updated on September 18, 2022

Comments

  • rancho
    rancho over 1 year

    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
    rancho almost 8 years
    But where is terminal in your diagram? What do you mean by "frontend to the shells "
  • rancho
    rancho almost 8 years
    Then terminal should also lie between user and shells to provide a CLI enviroment?
  • Aniket Bhattacharyea
    Aniket Bhattacharyea almost 8 years
    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.
  • rancho
    rancho almost 8 years
    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?
  • Law29
    Law29 almost 8 years
    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.
  • ctrl-alt-delor
    ctrl-alt-delor almost 8 years
    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.))
  • Stéphane Chazelas
    Stéphane Chazelas almost 8 years
    Hardly any Unix or Unix-like still has a Bourne shell nowadays.
  • rancho
    rancho almost 8 years
    @Law29 You are the best
  • Law29
    Law29 almost 8 years
    @rancho Thank you (but I fail to see why you removed your accept of my answer, then . . .)
  • rancho
    rancho almost 8 years
    @Law29 It is because your original answer is too technical and difficult to grasp. A diagram is much more preferrable.
  • Elliott
    Elliott over 2 years
    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?