Writing a Message to Logged in Users through the Terminal
To write a message to logged in users, you can use a write command. The write utility allows you to communicate with other users, by copying lines from your terminal to theirs.
First of all you need to check who is currently logged in, and which terminal he is logged in to.
root pts/0 2012-04-25 12:57 (192.168.0.207)
john pts/1 2012-04-25 13:20 (192.168.0.101)
Now you can write a messages to the user John. For example :
When you hit 'Enter', your message will be sent to that terminal.
Also you can cat a file and pipe it to the write command too :
To broadcast your message to all logged in users you can use a wall command (wall = write to all) :
Hey you people!
Or you can cat a file and pipe it to the wall command :