Linux tty command
The Linux tty command is used to display the file name of the terminal connected to standard input.
In Linux operating systems, all peripheral devices have their names and codes, which are stored as special files in the /dev directory. You can execute the tty (teletypewriter) command to query the file name of the currently used terminal.
Syntax
tty [-s][--help][--version]
Parameter Description:
- -s or --silent or --quiet Display no information; only return the status code.
- --help Online help.
- --version Display version information.
Example
Display the current terminal
# tty
/dev/pts/4
Linux Command Reference