8

I know that terminal can be started by Ctrl+Alt+T. But sometime users say about command-line with Ctrl+Alt+F2.

So, Is there any difference in working between them? And when should I use between them?

What is called tty?

Braiam
  • 67,791
  • 32
  • 179
  • 269
Pandya
  • 35,771
  • 44
  • 128
  • 188

1 Answers1

12

The virtual terminals (the ones you get to with Ctrl Alt F1-9) go back to the roots of Linux. Remember that Linux was originally a command-line only system and designed for multiple users. The idea was that each user could log into a single tty. This would not happen on the same physical machine of course, think of servers that many computer terminals would connect to. Each user would connect using a different computer and the server would log them into a tty.

This has nothing to do with the tty command which is part of coreutils. The tty command is simply a tool that lets you know the name of the terminal you are currently using.

The "terminal" (actually called a "terminal emulator") is simply a GUI program that mimics the old behavior. It lets you run a shell (bash in the default Ubuntu) from within your X session.

The main point is that both the virtual terminals and the terminal emulators provide you with a command line interface, a shell. They are basically the same thing. The only important difference from a practical point of view is that the terminal emulators run interactive, non-login shells while if you drop into a tty and login there, you will run an interactive, login shell. For more information on the differences between these two types of shell, see here.

I suggest you also read this excellent Q&A on Unix & Linux:

What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'?.

terdon
  • 100,812
  • 2
    Another important difference is that the VC do not need the graphic system to run, so it's available in case of X11 not working (wrong graphic drivers, errors in startup scripts, etc). – Rmano May 18 '14 at 05:17
  • Thanks, but if "the virtual terminals (the ones you get to with Ctrl Alt F1-9) go back to the roots of Linux", I'm wondering, the terminal goes back to which part of Linux, please ? I'm a little confused – DiaJos Sep 09 '18 at 11:50
  • 1
    @Webman I don't understand what you mean. It might be better to ask a new question, but what I mean here is that these virtual terminals are there because Linux was designed for multi user systems. – terdon Sep 09 '18 at 11:51