As we all know by now, a file represents everything in Linux, and devices are no exception. All your devices are located inside the /dev directory; this includes your keyboard, mouse, terminal, hard disk, USB devices, CD-ROM, and so on.
The terminal you are working on right now is, in fact, a device. If you run the w command, you will see the name of the terminal you are connected to in the second column of the output.
elliot@ubuntu-linux:~$ w
11:38:59 up 17 min, 1 user, load average: 0.00, 0.00, 0.02
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
elliot pts/0 172.16.1.67 11:22 0.00s 0.06s 0.00s w
In my case, it is pts/0; pts is short for pseudoterminal slave. Now, this terminal is represented by the file /dev/pts/0:
elliot@ubuntu-linux:~$ ls -l /dev/pts/0
crw------- 1 elliot tty 136, 0 Nov 7 11:40 /dev/pts/0
I will echo the line Hello Friend to /dev/pts/0 and pay close attention to what will happen:
elliot@ubuntu-linux:~$ echo "Hello...