Linux or UNIX - Find tty name
To print the file name of the terminal connected to standard input (keyboard) you need to use command called tty.
This command is available on Solaris, Linux, FreeBSD, and other Unixish operating systems.
The tty utility writes the name of the terminal attached to standard input to standard output.
You can also use who or w command to find out terminal/tty. Type tty command as follows:
$ tty
Output:
/dev/pts/2
Use following command:
$ tty
Output:
/dev/tty3
You can also use w or who commands to find out tty:
$ w
Output:
NAME LINE TIME COMMENT vivek tty1 Feb 6 00:26 root tty2 Feb 5 14:57
OR use who command:$ who
vivek tty1 Feb 6 00:26 root tty2 Feb 5 14:57
In above output second column indicates the tty name.
See also:
E-mail this to a friend
Printable version
Related Other Helpful FAQs:
- Find File on Linux
- Finding files in Linux filesystems
- Find files that do not have any owners or do not belong to any user under Linux/UNIX
- Linux: How can I find a file on my system?
- Locate files on linux, FreeBSD and UNIX system
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!


Recent Comments
Yesterday ~ 3 Comments
Yesterday ~ 2 Comments
10/14/2008 03:10 pm (2 days ago) ~ 3 Comments
10/14/2008 01:36 pm (2 days ago) ~ 3 Comments
10/14/2008 10:04 am (2 days ago) ~ 1 Comment