To write a message to users who are logged in, you can use the command write. But before that, you need to check who is logged in, and which terminal they are logged in to. Use who command to see who is logged in, and to what terminal.
This will only work if the other user has "mesg" turned on. (i.e. "mesg y")
First, type:
who
who will list of all user have login and and login to which terminal, you will see something like pts/0, pts/1.
Example output:
aizatto pts/0 2007-03-10 02:21 (:0.0)
With the information, now you can write messages to the user aizatto.
write aizatto pts/0
After typing the command line above, you can start to type your messages. When you hit enter, you message will be send to that terminal. Terminate the write by ctrl+D.
You can cat a file and pipe to write command too.
cat memo.txt | write aizatto pts/0
You can broadcast your message to all logged in users with the wall command if you are logged in as root.
cat announcement.txt | wall
Or simply type wall, then start to write your message. For wall, the message will be send only after you hit ctrl+D. And the message will be send to all users that login including you.