What is the difference between "Shell" and "Terminal"? [duplicate]
I am fairly new to Ubuntu and I am loving it!
But I don't quite understand the difference between the shell and the terminal. Can any one explain? Someone told me that a terminal is just a "tool" to view the shell, akin to using a browser like Firefox or Chrome to "view" the web.
Is his analogy correct? Also what is the default shell of Ubuntu? Bash, tcshell, or something else?
The shell is a program which accepts your commands (ls
, cd
, etc) and processes them by running built-in functions (like cd
) or calling external programs (like ls
or gcc
).
The terminal is the thing (almost always a program these days, but often a piece of hardware back in the bronze age) that manages your keystrokes and shows text to you---both the bits you type and the bits the shell or another program returns to you. When the terminal is a GUI program it draws the nice graphical window, tells X what font to use, calls the text drawing routines and so on. In the old days it might have been little more than a fancy electric typewriter with fan-fold paper.
That's not a bad analogy at all. A terminal can be considered as just a device to display information and receive it. It can range from a dumb terminal which does nothing but interpret printable characters, to a behemoth with full cursor positioning and colour capabilities.
A shell, which often (but not always) runs in a terminal, is a powerful environment for interpreting commands and acting on them. You can consider most modern shells to be full-blown programming languages.
The basic idea behind an interactive shell is to accept those commands from the user (via the terminal) and act on them, either by doing its own stuff or running external programs to do it. A non-interactive shell is the one that generally runs pre-written scripts to perform tasks. Quite a few shell scripts will run without a terminal, since they have no need of user interaction.
Ubuntu's default shell is bash, although it's easy to change it to whatever you want.
That is correct. The terminal emulator provides graphical handling for displaying a window, menu, etc. and text output, along with input via keyboard (and mouse, under certain conditions) to command-line programs.
The shell provides a flexible command line for input of commands to be executed, along with feedback on things such as the current directory, the superuser status, and so on.
The current default shell for Ubuntu is bash.
The default shell in Ubuntu is bash. Also, the shell is a program that you use to interact with the system (one of many ways to do this). By terminal, you mean a 'terminal emulator'. A terminal emulator could be considered a 'fake monitor', if you will.