write - it creates a communication line between two logged-in users through the terminal

syntax
$ write <user> <tty name>

To write a message to user2 from user1
$ write user2
this is test message
^D

To pipe a message to write
$ echo "Hello from user1" | write user2

To write a message from file
$ cat msg.txt
this is test msg

$  write user2 < msg.txt

To write to specified tty
$ write user2 pts/0



regards,
T.Dhanasekar