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:
Use following command:
You can also use w or who commands to find out tty:
NAME LINE TIME COMMENT vivek tty1 Feb 6 00:26 root tty2 Feb 5 14:57
OR use who command:
vivek tty1 Feb 6 00:26 root tty2 Feb 5 14:57
In above output second column indicates the tty name.
See also:Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?