Terminal Vs. Shell [duplicate]

Posted on

Problem :

Possible Duplicate:
What are the differences between shell , console & terminal?

This probably sounds like a stupid question but I’m having a lot of trouble clearly differentiating between a shell (such as Bourne or bash) and the Terminal application in GNOME. I realise that both are completely different but I can’t seem to find a clear answer written in text. Could anyone clearly distinguish between both?

Solution :

The terminal program is just a graphical interface to the shell. The shell is what actually handles commands and so forth; the terminal program just gives it a way to interact with the graphical environment.

The shell is a typical Unix program. It reads commands from the standard input and prints something on the standard output. This is simple and good.

The points is: In a graphical environment (like GNOME or KDE) a program cannot just write text directly on the desktop. If the programs could, this would quickly become a mess and chaos. Therefore you need a program that provides a space where other programs can write their text. That program also accepts keystrokes from the user and converts them into byte sequences, since this is what many programs (command-line, text based, not GUI) expect. All this is the job of the GNOME Terminal application.

So you have the shell (probably bash), and wrapped around it is the GNOME terminal. To see what exactly the GNOME terminal does you can run (Alt+F2) gnome-terminal, xterm and rxvt in between and see where they are different and what they have in common.

I think what you are really asking is what is the difference between the console and a terminal application like xterm?

If so, the console is local to the machine, there can only be one console. The output of the console is directed to /dev/console which usually means your monitor. A terminal, on the other hand, is really a terminal emulator which harkens back to the days when mainframes were as big as entire rooms and you had users interact with dumb terminals that were remote to the mainframe. The terminals would send terminal commands over a serial line to the mainframe to interact with it. Now a days, we still use terminals, but they are emulated so we can use more than one (each tied to a pseudo tty like /dev/pts#) and we can even use them remotely and forwarded their connection over an encrypted SSH channel along the internet.

Both the console and a terminal application invoke your shell(s) upon login.

The Terminal is essentially an emulated shell in a window.

If you want to see a real shell sans Terminal, hit Ctrl+Alt+F1 and Ctrl+Alt+F8 to go back to the graphical interface.

Leave a Reply

Your email address will not be published. Required fields are marked *