0
Writing file to /dev/tty
and /dev/pts/7
in this case results that it is printed in console:
$ echo hello > file.txt
$ cp file.txt /dev/tty
hello
$ tty
/dev/pts/7
$ cp file.txt /dev/pts/7
hello
Do these two files are synonyms in this case?
0
Writing file to /dev/tty
and /dev/pts/7
in this case results that it is printed in console:
$ echo hello > file.txt
$ cp file.txt /dev/tty
hello
$ tty
/dev/pts/7
$ cp file.txt /dev/pts/7
hello
Do these two files are synonyms in this case?
1
Yes, they act identically. /dev/tty
is a special character device that resembles your "current terminal". This is for convenience, so that you don't have to look what your actual terminal is when needed but just can open /dev/tty
, independent whether it's /dev/pts/5
or /dev/pty7
or /dev/tty3
.