Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Both Mac OS X and Ubuntu (and other Linus OS) has terminal / command line.

Are these terminal identical across different OS? If not, what are the important difference?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

A Terminal emulator provides an interface to run a shell, which again is an interface to access your operating system functions.

Terminals used to be real machines, e.g. a monitor with a keyboard attached, which sent your keystrokes to the actual computer at the other end, and receiving output from this computer. For example, the famous VT100:

Nowadays, this is emulated by those applications, like the Terminal.app on OS X, or GNOME Terminal for the GNOME graphical interface on Linux distributions.

As it's decoupled from the shell that you can run (e.g. bash, zsh, ...), you are free to use any other terminal emulator. For example, on OS X, you can use iTerm 2, which offers a bit more than the normal terminal application.

As the terminal is the bridge between your GUI and the text-only shell, its functionality should go beyond accepting keyboard input and displaying output from the shell. A terminal should supply you with means of:

  • copying and pasting to the GUI
  • sending special commands to the shell (so called escape sequences; your terminal will for example map Cmd - Right Arrow to an appropriate shell sequence to go to the end of the line*)
  • allowing other shortcuts with hotkeys
  • allowing the shell to track the mouse
  • allowing multiple tabs with different shells running at the same time
  • allowing you to drag a file icon to the shell to get its real path
  • notifying the GUI of events (such as a blinking screen, or Growl output)
  • etc.

To sum it up: Different terminals offer different functionality with regards to how they interact with your operating system on the one hand, and the shell on the other hand. You can find a comparison of terminal emulators on Wikipedia.

That being said, there isn't an important difference. Most people set up terminals to their liking, e.g. some like a transparent background, whereas others don't. Some like them to display their shell black on white, others rather like it green on black.**
Some terminals allow you to set up different keyboard shortcut profiles, or even other profiles that launch different shells on startup, with a different windows size, etc.


* Note that this is a rather simplified statement. The terminal just needs to find a way to map special keys – especially on Macs, where there's a Command key – to commands a shell can understand.

** This is also a functionality of the terminal: Displaying colors. You can actually tweak your terminal to show stuff the shell intended to be green as red instead. It's primarily a matter of customization.

share|improve this answer
    
Windows console as in CON? –  Daniel Beck Dec 30 '11 at 10:06
    
@DanielBeck Isn't it that? If not, please enlighten me, I really don't know much about Windows here. –  slhck Dec 30 '11 at 10:10
    
No idea, that's why I'm asking. I only know of the DOS device name, and that writing to it (echo foo > con) makes the output non-redirectable later. –  Daniel Beck Dec 30 '11 at 10:12
1  
Windows is a wholly different ball game, since it and its predecessors never really had the full glass TTY paradigm in the first place. I recommend simply taking that sentence out of your answer. It's misleading at best, and explaining Windows is not really within the purview of this question in the first place. –  JdeBP Dec 30 '11 at 18:21
    
@jdeBP Done so. How does it work on Windows then? –  slhck Dec 30 '11 at 18:58
show 1 more comment

note: the terminal is a wrapper program which runs the shell. the term derives from times where it still was a physical device (keyboard).

the shell (or command interpreter) runs commands and returns the results. you basically can run the same shells on both operating systems:

  • bash
  • csh
  • ksh
  • zsh

shells of the mentioned operating systems (in question tags) are all using the same core commands because they are UNIX-like and have to fulfill the POSIX standard. this is why you will feel familiar on both OSs.

share|improve this answer
    
You haven't said a word about what the difference between terminals would be. You're only talking about shells. Shells are not terminals. –  slhck Dec 30 '11 at 9:18
    
thanks. added it to get an overview. –  udo Dec 30 '11 at 9:29
    
OS X uses bash as the default shell for all users, so your links are misleading. Almost all programs that are mentioned in the lists are independent of the shell used. –  Daniel Beck Dec 30 '11 at 10:04
    
thanks. removed links. note: even bash is the default shell, you can use a different shell if you like. –  udo Dec 30 '11 at 10:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.