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.

$ who
root     pts/0        2012-04-25 12:57 (
john     pts/1        2012-04-25 13:20 (

Now you can write a messages to the user John. For example:

$ write john pts/1

When you hit ‘Enter’, your message will be sent to that terminal.

Use Ctrl+D to terminate write

Also you can cat a file and pipe it to the write command too:

$ cat file.txt | write stan pts/1

To broadcast your message to all logged in users you can use a wall command (wall = write to all):

$ wall
Hey you people!

For wall, the message will be sent only after you hit Ctrl+D

Or you can cat a file and pipe it to the wall command:

$ cat announcement.txt | wall
Recommended Book

This is a must-read for anyone who wants to understand, explain and implement DevOps culture, process and tools for high performance development and operations.

All DevOps practices in a single place - organisational, cultural and technical. Lots of exceptional case studies.

Increase profitability, elevate work culture, and exceed productivity goals through DevOps practices.

One Reply to “Writing a Message to Logged in Users through the Terminal”

  1. 1. > cat announcement.txt | wall
    $ wall announcement.txt

    2. Забыли про yes в mesg

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.