1.

Which of the following files are known as special files in UNIX?(a) sample.txt(b) /dev/null(c) /dev/tty(d) /dev/null and /dev/ttyThis question was addressed to me in final exam.Query is from Redirection and Pipes in division The Shell of Unix

Answer»

Correct answer is (d) /dev/null and /dev/tty

The explanation is: There are two special files named /dev/null and /dev/tty which is used in UNIX for special purposes. For example, if we want to check whether the program runs SUCCESSFULLY without seeing its output on the screen or may not want to SAVE output in a file either. For this purpose, a special file /dev/null is used. It accepts any STREAM without GROWING in size. The second file /dev/tty is the one used for indicating one’s terminal.



Discussion

No Comment Found

Related InterviewSolutions