Wall Command in Linux Terminal with examples

Wall Command in Linux Terminal with examples

In this article we are going to shows how to use wall command in Linux Terminal. If you want to learn about wall command in Linux with Examples then this post is ideal for you.

The wall is a command line utility that is used to show message on the linux terminals of all logged-in users. It stands for write all.

How to use wall Command to Broadcasting a Message

In the Linux, the basic syntax of the wall command is show as below:

wall [OPTIONS] [FILE|MESSAGE]

For an Example :

Run the wall command with the message as an argument:

$ wall "The system will be reboot in 5 minutes."
Output
Broadcast message from root@studiesonline (pts/0) (Wed Jan 27 18:12:17 2021):
The system will be reboot in 5 minutes.

The above command display the message to the all logged in users.

The command with the -n (--nobanner) option to suppress the banner and show only the text you types to the logged-in users.

$ wall -n "The system will be restarted in 5 minutes."
Output
The system will be reboot in 5 minutes.

Run the wall command without any argument to write multi-line messages:

$ wall

The wall command will wait for you until the message text entered by you. When you are done to typing the message, Press Ctrl+D to end the program and broadcast the message.

You can also use it with other command using piping. For an example use the echo command to broadcast multi-line messages:

$ echo "The system will be reboot in 5 minutes. \nPlease close and save your all programs." | wall

Broadcasting a Message From a File

If you are sending the same messages everyday and you don’t want to re-type same message again and again then write each messages to a file. Because wall command allows to Broadcasting a Message From a File.

wall command reads messages from the file only when it is run as root.

To broadcast the message from of a file, simply run the wall command with the file name:

$ wall messagefile.txt

Broadcasting a Message to a Group

If you want to broadcasting a Message to a group members only then run the wall command with the -g (--group) option followed by the group name:

wall -g studiesonline "The system will be restarted in 5 minutes."

That’s all.

If you face any error and issue in above steps , please use comment box below to report.


If our tutorials helped you, please consider buying us a coffee. We appreciate your support!

Thank you for your support.

Leave a Comment

Your email address will not be published. Required fields are marked *

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

Scroll to Top