Which file is used for indicating terminals?

Which file is used for indicating terminals?
A. /dev/tty
B. /dev/null
C. terminal file
D. device file
 
Answer: a
Explanation: /dev/tty is another special file which is used for representing one’s terminal. Consider user1 is working on terminal /dev/pts/1 and user 2 is working on /dev/pts/2. Then, both the users can refer to their own terminals with the same filename. For example, if user 1 issues the command
Code:
$ who > /dev/tty
Then, the list of users is sent to the terminal he is currently using — dev/pts/1. Similarly, user 2 can also issue the same command to see the output on his terminal, /dev/pts/2.
/dev/tty can be accessed by multiple users without conflict.
 

Tìm kiếm

Back
Top