What is tty terminal in linux

What does «TTY» stand for?

On the Wikipedia’s article (Computer terminal) under the hard copy terminals section of the article it says this «Early user terminals connected to computers were electromechanical teleprinters or teletypewriters (TeleTYpewriter, TTY). » So does TTY stand for teletypewriters? But it doesn’t make any sense for me because I have never seen it and have no idea what «tele» means.

Yes, the origin of TTY in Unix is from teletypewriter. The tele in telephone, teletypewriter, etc comes from a Greek root meaning far or distant. TTY’s provide a virtual interface similar to what the physical machines provided. This is the origin of the 80 char width and the carriage return and linefeed codes.

If you don’t know what tele means, that suggests you might be weak in Greek and Latin prefixed and suffixes. This is an important language skill, because a good chunk of the English Language is built on this, and knowing the pieces lets you guess the meanings of unfamiliar words. Spend a few hours over the next few weeks studying some web resources on Greek and Latin roots, suffixes and prefixes. (Seriously though, never heard of television? telephone? telekinesis? teleportation? telegraph? telegram? telescope? telemarketing? telecommuting?)

7 Answers 7

Early user terminals connected to computers were electromechanical teleprinters or teletypewriters (TeleTYpewriter, TTY), and since then TTY has continued to be used as the name for the text-only console although now this text-only console is a virtual console not a physical console.

There are 6 virtual consoles in Ubuntu accessed by the keyboard shortcuts Ctrl + Alt + F1 to Ctrl + Alt + F6 . You can move away from a virtual console (move the console to the background) by using the keyboard shortcut Ctrl + Alt + F7 .

In Ubuntu 17.10 the login screen now uses virtual terminal 1. In Ubuntu 17.10 and later press Ctrl + Alt + F3 up to Ctrl + Alt + F6 for accessing a virtual console and press Ctrl + Alt + F2 to go back to the desktop environment.

enter image description here

Ubuntu 18.04 virtual console

Moving back to the graphical console from, say, tty2, doesn’t «close» tty2. It just moves you away from it. The tty is still active and running. Plus, if you logged in there, you will still be logged in there.

Does anyone know why they chose to have exactly 6 terminals and one GUI? Why not five or seven terminals? Why not two GUI sessions?

Because most Linux distributions are open source, the number of virtual ttys can be changed in some Linux distributions as follows. 1. How can I reduce the number of TTYs? 2. How to increase virtual terminal in Linux. One example of why a user would want to change the number of virtual ttys is if the user had number of devices like Raspberry Pis connected to a single desktop computer, all at the same time.

@AaronFranke GUI sessions are not nearly as flexible as terminals. If you start introducing simultaneous GUI sessions, you get race conditions and inevitable anarchic chaos

Читайте также:  Kyocera 1020 mfp драйвер linux

@AaronFranke There is a lock on the X server for the reasons that karel and forrest gave which prevent you from starting more than one instance at a time, or forwarding X11 while on SSH if there is an X instance running elsewhere.

This is a teletype writer:

teletype writer

Pressing a key sends a character down the serial link. Incoming characters on the serial link are printed on the printer. So when you type ls , you get a hardcopy of the file listing.

pj50 probably meant «Pressing a key (hard) . » I’m pretty sure this is the device that was responsible for ‘hit’ in «hit return».

Same applies to the IBM model M buckling-spring keyboard 🙂 I suspect they were calibrated for typists used to mechanical typewriters and the force required there. I’m astonished that this answer has been so popular! Maybe I should have included more about serial lines and multiple TTYs.

is this just a fancy name for saying «I am using the terminal» or the «the process related to the terminal i.e. the process that exchanges information with the system and you»?

Yes, the origin of TTY in Unix is from teletypewriter. The tele in telephone, teletypewriter, etc comes from a Greek root meaning far or distant. tele + phon (sound) = Speaking at a distance and so on.

Timeshare systems (pre-Unix) developed physical terminals that allowed you to interact with (share) the computer during your scheduled time. These terminals meant you did not have to be physically in front of the computer to use it. You could also send output to a teletypewriter, that would print the output at that location.

This was the existing physical infrastructure when Unix was developed, so it was natural to use it for Unix networking. Emulation in virtual or software terminals of the features in physical terminals prevented older code or network infrastructure from breaking.

It’s this origin in physical terminals (and ultimately the machines origins in the telgraph (distant writing) system and their use of control codes that accounts for certain terminal standards today. These include the standard 80 character width and the carriage return and linefeed codes.

I was just curious about what «tele» and «phone» really mean and saw your answer. It is really cool to explain that. Thanks +1

is this just a fancy name for saying «I am using the terminal» or the «the process related to the terminal i.e. the process that exchanges information with the system and you»?

The first printing telegraph machine was patented in 1846. Various companies continued developing them, and the word «Teletype» was first trademarked in 1921. One of these companies changed its name to the Teletype Corporation in 1928 and was acquired by AT&T in 1930. (Source: en.wikipedia.org/wiki/Teleprinter)

So these machines had seen almost 100 years of development before the first computers, and were the obvious choice for a human-interface device. There were more expensive terminals, but Teletypes were usually the cheapest and most reliable choices. AT&T/Bell Labs owned Teletype corporation when Unix was first developed, and the Digital Equipment computers it was developed on included Teletype 33ASR terminals as standard equipment. TTY was the device name for terminals on the PDP-7 and PDP-11 that Unix originated on, it probably went back to the PDP-1 and who knows what before that. So when they started working on a terminal device handler for Unix, why would they use anything else?

Читайте также:  Узнать какая версия линукс установлена

I was confused when I first learned that MSDOS used COM: as the device name for serial ports. I thought TTY was handed down from the ancients, this is heresy!

Источник

What is TTY in Linux?

Sooner or later, you’ll come across the term tty while using Linux. Learn what it is and what is its significance.

You must have heard about the term “TTY” when it comes to Linux and UNIX. But, what is it? Is it useful to you as a desktop user? Do you need it? And, what can you do with it? In this article, let me mention everything essential to get you familiar with the term TTY in Linux. Do note that there’s no definitive answer to this, but it relates to how input/output devices interacted in the past. So, you will have to know a bit of history to get a clear picture.

History Behind the Term ‘TTY’

wacsoperateteletype

It all starts with a Teleprinter in the 1830s. Teleprinters let you send/receive text messages over the wire. It was a replacement to Morse code communication, where two operators were needed to effectively communicate with one another. And, a Teleprinter just needed a single operator to easily convey a message. While it did not have a modern-layout keyboard, its system was later evolved by Donald Murray in 1901 to include a typewriter-like keyboard. The Murray code reduced the effort for operators to send a message. And, this made it possible for a Teleprinter to evolve as a commercial Teletypewriter in 1908. TTY is shorthand for Teletypewriter. The difference between the Teletypewriter and a regular typewriter was that a Teletypewriter was attached to a communication device to send the typed message. Teletypewriter made it possible for humans to communicate faster over a wire without any computers until now. And, this is where “TTY” came into existence.

The (relatively) Modern Concept

Now, you must be wondering, how did it land into modern computing and in Linux? Well, for starters, when Teletypewriter hit the market, some years later semiconductor transistors were developed which then evolved into microprocessors making a computer possible. Initial computers didn’t have the concept of a keyboard. Punch cards were the input method. punch card programWhile computers were evolving, batch input cards were eventually replaced by Teletypewriters as a convenient input/output device. lgp 30 early computer 1956With technological advancements, the Teletypewriters were ‘virtualized’ using electronics. So, you wouldn’t need a physical, mechanical TTY, but a virtual, electronic TTY. Earlier computers didn’t even have video screens. Things were printed on paper instead of displaying on a screen (which didn’t exist). And hence you see the use of the term ‘print’, not ‘display’. Videos were added to terminals later as technology advanced. In other words, you might have heard of them as video terminals. Or, you could call them “physical” terminals. And, then these evolved into software emulated terminals which came with enhanced abilities and features. This is what you call a “terminal emulator”. For instance, GNOME Terminal, or Konsole, are some of the best terminal emulators that you will find for Linux.

Читайте также:  Find linux file owner

So, What is TTY in Linux?

When it comes to Linux, TTY is an abstract device in UNIX and Linux. Sometimes it refers to a physical input device such as a serial port, and sometimes it refers to a virtual TTY where it allows users to interact with the system (reference). TTY is a subsystem in Linux and Unix that makes process management, line editing, and session management possible at the kernel level through TTY drivers. In terms of programming, you need to dive in deep. But, considering the scope of this article, this could be an easy definition to digest. If you are curious, you can explore an old resource (TTY Demystified) that tries to clear up TTY in Linux and Unix systems with all the technical details you need. In fact, whenever you launch a terminal emulator or use any kind of shell in your system, it interacts with virtual TTYs that are known as pseudo-TTYs or PTY. You can just type in TTY in your terminal emulator to find the associated PTY.

How to Access TTY in Linux?

ubuntu ttyIt is easy to access TTY in Linux. In fact, when I did not have a clue what it was, I accidentally accessed it and panicked about what to do (how to get out from it). You can get the TTY screen by using the following keyboard shortcuts on most distributions: CTRL + ALT + F1 – Lockscreen
CTRL + ALT + F2 – Desktop Environment
CTRL + ALT + F3 – TTY3
CTRL + ALT + F4 – TTY4
CTRL + ALT + F5 – TT5
CTRL + ALT + F6 – TTY6 You can access up to six TTYs in total. However, the first two shortcuts point to the distribution’s lock screen and the desktop environment. ubuntu tty4So, you get a command-line interface with the rest of the shortcuts.

When Would You Use TTY in Linux?

TTY is not just a technical treasure. It is useful even for users like me who aren’t developers. It should come in handy in case the graphical desktop environment freezes. In some cases, reinstalling the desktop environment from the TTY helps resolve the program. Or, you can also choose to carry out tasks in TTY like updating the Linux system and similar, where you do not want visual issues to interrupt your process. Worst-case scenario, you can go to the TTY and reboot the computer if your graphical user interface is unresponsive. Some users also prefer to perform large file transfers with the help of TTY (I am not one of them).

TTY as a Command in Linux

ubuntu terminal tty command

When you type in TTY in your terminal emulator, it will print the file name of the terminal connected to the standard input, as described by the man page. In other words, to know the TTY number you are connected to, just type in TTY. And, if there are multiple users connected to the Linux machine remotely, you can use the who command to check what other users are connected to.

Источник

Оцените статью
Adblock
detector