O'Reilly logo
  • Ivan Petrov thinks this is interesting:

The test for input file equals output file is done only for nondevice files. This makes it possible to use cat to copy input from device files to themselves, such as with terminals:

$ tty                                 Print current terminal device name
$ cat /dev/pts/3 > /dev/pts/3         Copy keyboard input to screen
this is a line of text                Type in a line...