1

I have searched a lot about it but could not get an answer. I read somewhere that linux Ubuntu has 6 or 7 terminals.

We can start them by pressing -

Ctrl+Alt+(F1-F6)

and to get back to GUI-

Ctrl+Alt+F7

So what i want to know is what is the difference between these 6 different terminals , and how can we use them as per to different purposes??

Braiam
  • 67,791
  • 32
  • 179
  • 269
Sukupa91
  • 3,037
  • 2
  • 20
  • 33

3 Answers3

4

In fact there are not only 6 or 7 ttys, there are many more. You could see them, try

ls /dev/tty* | wc -l

All the consoles are not always active. You need to activate ttyN in order to switch to it with Ctrl+Alt+F N. You can activate any tty with openvt command also. See man openvt.

Reason why there so many ttys, may have historical baskground. In old days Linux was used in terminals (without X server).

  • To do multiple tasks at the same time it was indispensable to have more than one ttys.

  • due to any accidentally break, it was required to have another tty from where system could be monitored.

  • Even to read more than one man pages, different ttys were needed.

Nowadays for most users don't need that many — in fact most users never see anything but first 6 ttys to be available for CUI login and the virtual console that X is running on. As Rinzwind mentioned all these terminals are mostly identical.

But there are a few people who patch their kernel to allow more than 63 consoles(special ttys), because they run large machines with many hardware consoles.

sourav c.
  • 44,715
  • yeah there are 103, can you tell me what kind of multiple tasks ?? – Sukupa91 Dec 04 '13 at 10:29
  • There may be many different type. For simplest example consider a situation, to write a code and to run and monitoring its output how it is using system resources. Please keep in mind you don't have a X system and multiple windows. – sourav c. Dec 04 '13 at 10:37
  • +1 for explanation . thanks .. now i understand how it is useful in terms of multitasking. – Sukupa91 Dec 04 '13 at 10:39
  • I got the answer.. – Sukupa91 Dec 05 '13 at 05:29
  • ls -la /dev/ | awk '{print $NF}' | grep "^tty" | wc -l is a funny way to go about it. ls /dev/tty* | wc -l does the same thing. You're using awk to undo the damage done by adding -l to ls for no reason. – Steven K Jan 10 '17 at 05:47
  • @StevenKath You are correct. I did that long time back, can't remember the reason if any. I am on mobile device, will edit it as I get a chance. Thank You. – sourav c. Jan 10 '17 at 06:13
  • @souravc Well, I sure wasn't expecting a 30 minute response time on a 3-year-old thread. You are a true soldier. – Steven K Jan 10 '17 at 06:49
3

There is no difference between the 6 terminals -by default-. It is up to the user to think of use cases.

On a server setup I have seen these used to automate a login after booting up to start software. It is also possible to have the desktop to show more than 1 desktop manager: Unity on tty7, KDE on tty6 and XFCE on tty5 (but installation wise it might be a bit more difficult than it used to be).

Rinzwind
  • 299,756
1

Virtual Terminals are provided as a convenience. They come in very handy when troubleshooting problems with the GUI.

On servers that do not have a GUI they are indispensable.

http://en.wikipedia.org/wiki/Virtual_console