Wall command is used to send a message to currently logged-in users, and a system administrator mainly uses this command to notify other users about forthcoming maintenance updates.
All users will be notified only if the terminal is working, but nowadays you can also get messages on the notification panel irrespective of whether the terminal is running.
If you want to send a message to a specific user, then use the "write" command.
In this article, you will see multiple ways to notify users using wall command.
Table of Contents
How to send or message to user using wall
There are certain features or options that are only available to privileged users. If you want to execute those options, then make yourself a root user by following the steps to becoming a SUDO user in Linux.
It would be best if you read this to Check all logged-in users information before the broadcasting message.
Broadcast message to all logged-in users
The primary way to broadcast messages to all logged-in users is to run a wall command and type the message that you want to convey like the below snippet:
$ wall "NFS server will be in maintenance till EOD."
Output: Broadcast message from trendoceans@shen (pts/1) (Wed Mar 2 18:48:57 2022): NFS server will be in maintenance till EOD.
When you just run the wall command without any input, you will get the option to write the message on a screen, and when it’s complete, simply press ctrl-d to broadcast the message to all logged-in users.
$ wall "Enter your message here and press ctrl-d"
Instantly, you will get the message on your terminal and other users too.
Output: Broadcast message from trendoceans@shen (pts/1) (Wed Mar 2 18:37:12 2022): Enter your message here and press ctrl-d
Broadcast message to a group
What should I do when I just want to send a message to a specific group instead of sending it to everyone? For that, you can specify the group name using the -g or –group options.
$ wall -g sales "Printer is unavailable. Sorry for the inconvenience."
Moreover, you can also use GID instead of the group name.
$ wall -g 1005 "Printer is unavailable. Sorry for the inconvenience."
Broadcast message without banner
In a standard output, you get extra details like from where you received the message and pseudo-terminal info with a timestamp. If you don’t want to send this detail along with your message, then use -n or –nobanner.
And to access this, you need to have sudo privileges.
# wall -n "NFS server will be in maintenance till EOD."
Output: NFS server will be in maintenance till EOD.
Broadcast message with a file
Why rewrite messages repeatedly when you can specify a file or message template in a wall command? To declare a template, provide the file name with a wall command:
# wall system_maintenance_message.txt
Unfortunately, this feature is only accessible to root users.
Check the steps to be a SUDO or root user in Linux
Troubleshoot if you are not reciving message
The Wall command will print messages only if the user’s terminal is running, and I’m not sure about other desktop environments, but the KDE desktop environment notifies in a notification panel similar to the below image, even if the terminal is not working.
As you know, wall commands use mesg utility to write a message on your terminal screen. So, the first step of troubleshooting is to check mesg status.
If the output show ‘is n‘, then you need to change by passing the below command:
$ mesg y
After that, you can try to send a message.
That’s all to notify all logged-in users using the wall command.
A man with a tech effusive who has explored some of the amazing technology stuff and is exploring more. While moving towards, I had a chance to work on Android development, Linux, AWS, and DevOps with several open-source tools.