wall is a command-line utility that displays a message on the terminals of all logged-in users. The messages can be either typed on the terminal or the contents of a file. wall stands for write all, to send a message only to a specific user use the
Broadcasting a Message
The syntax for the
wall command is as follows:
If no file is specified
wall reads the message from the standard input.
The most straightforward way to broadcast a message is to invoke the
wall command with the message as the argument:
The message will be broadcasted to all users that are currently logged in.
To see all the logged-in users, run the
To suppress the banner and show only the text you types to the logged-in users, invoke the command with the
wall -n "The system will be restarted in 10 minutes."
If you want to write multi-line messages, invoke the command without an argument:
wall command will wait for you to enter text. When you’re done typing the message, press
Ctrl+D to end the program and broadcast the message.
You can also use the here-string redirection or pipe the output of another command to
wall. Here is an example showing how to use the
echo command to broadcast multi-line messages:
Broadcasting a Message From a File
If you are regularly sending the same messages, you can write each one of them to a file, so that you don’t need to re-type the same text.
wall reads from the file only when invoked as root.
To broadcast the contents of a file, invoke the
wall command followed by the file name:
Broadcasting a Message to a Group
To send a message only to members of a given group, run the command with the
--group) option, followed by the group name. For example, to write only on the terminals of the members of the “devs” group, you would run:
The group can also be specified by its GID (group ID).
wall command writes a message on the terminals of all currently logged-in users.