August 1999
Intermediate to advanced
1000 pages
83h 9m
English
/usr/bin/tty [-l][-s]
The tty command writes to the standard output the name of the terminal that is open as standard input. The name that is used is equivalent to the string that would be returned by the ttyname(3C) function.
| -l | Print the synchronous line number to which the user's terminal is connected if it is on an active synchronous line. |
| -s | Inhibit printing of the terminal path name; enables you to test just the exit status. The -s option is useful only if you want the exit status. It does not rely on the ability to form a valid path name. Portable applications should use test -t. |
The following example shows the output of the tty command from two separate terminal ...
Read now
Unlock full access