Linux for Programmers and Users

[Page 150 (continued)]

4.15. Identifying Terminals: tty

The tty utility identifies the name of your terminal (Figure 4-31).


[Page 151]

Figure 4-31. Description of the tty command.

Utility: tty

tty displays the pathname of your terminal. It returns zero if its standard input is a terminal; otherwise, it returns 1.

In the following example, my login terminal was the special file "/dev/pts/1":

$ tty ...display the pathname of my terminal. /dev/pts/1 $ _

Категории