Linux and Unix tty command

Quick links

About tty
Syntax
Examples
Related commands
Linux and Unix main page

About tty

Print the file name of the terminal connected to standard input.

Syntax

tty [OPTION]...

Options

-s, --silent, --quiet Print nothing, only return an exit status.
--help display this help and exit.
--version output version information and exit.

Examples

tty

Running tty by itself will display the current tty session as shown below:

 /dev/pts/0

Related commands

ps — Report the status of a process or processes.