Tuesday, May 28, 2019

tty

  • In Linux, everything is a file
any hardware device connected to the system is represented as a special file.
a terminal is also represented as a file
The tty command basically prints the file name of the terminal connected to standard input.

What is tty?
tty is short for teletype
popularly known as terminal
basically a device
allows you to interact with the system by passing on the data (you input) to the system, and displaying the output produced by the system.
ttys can be of different types
graphical consoles that you can access with the Ctrl+Alt+Fn key combination
terminal emulators like Gnome terminal that run inside an X session

 the meaning of each exit status:
    0 if standard input is a terminal
    1 if standard input is not a terminal
    2 if given incorrect arguments
    3 if a write error occurs

In unix terminology, the short answer is that

    terminal = tty = text input/output environment
    console = physical terminal
    shell = command line interpreter

https://www.howtoforge.com/linux-tty-command/

No comments:

Post a Comment