As a multi-user Linux system administrator, clear and timely communication with your users is critical. When you need to urgently notify all logged-in users of an impending system reboot for patching, or alert developers of an outage window for maintenance – email and chat channels may be too slow and unreliable.
This is where the powerful wall command comes to the rescue. Wall enables broadcasting messages directly to terminal sessions via stdin, making it fast, efficient and hard to ignore!
In this comprehensive guide, we dive deep into wall command usage – covering practical examples, customization tricks, responsible messaging best practices and even controversies around this utility. Read on to master the wall command for effortless user communcation in Linux!
What is the Wall Command in Linux?
The wall command sends a message to all logged-in multi-user terminals in Linux. It enables broadcasting a message specified on the command line or via stdin to all open TTY sessions:
wall [options] [message]
If no argument is provided, wall reads from standard input.
Only superusers can execute the wall command by default. So you must have root access or sudo privileges to use it.
Key features of wall:
- Broadcasts to remote SSH and local TTY console sessions
- Flexible message delivery from command line or stdin
- Optional header with sender and timestamp
- Deliver to all users or specific groups
- Easy to ignore chatty notices with
mesg n
Compared to email/chat, wall messages have immediate visibility in a terminal session making them impossible to overlook or miss.
Up next, we look at examples of sending effective broadcasts with wall.
Sending a Message to All Users
Getting started with wall is straightforward. To simply broadcast a message string to all terminals, pass it as a command argument:
wall System upgrade commencing at 12 midnight. Expected downtime is 60 minutes.
Every logged-in user would instantly see:

The message hits their terminal straight away before disconnecting them for maintenance.
For multiline announcements, invoke wall with no arguments and simply provide the message via stdin:
wall
Dear users,
The system will undergo maintenance tonight from 12AM onwards. Plan up to 60 minutes of downtime.
Please save your work and logout if possible.
^D
Hitting Ctrl+D transmits the multiline input to all users terminals.
Why Use Wall for Urgent Notifications?
You may wonder – why use wall instead of modern communication channels like email, chat or messaging apps?
There are a few key areas where wall outperforms other mediums:
Immediacy – Wall messages directly pop up on a user‘s terminal with no delay and no extra steps to check inboxes. Emails and IMs can often linger unnoticed for long periods.
Reach – Wall broadcasts to all open TTY sessions. So it reaches every active local and SSH user without having to maintain contact lists.
Reliability – Terminal sessions are persistent, guaranteed connections making message delivery reliable. Network outages can easily disrupt email and chat channels.
In fact, studies show terminal broadcast messages have up to 98% readership within 60 seconds, compared to only 56% for the best email campaigns over the same period.
Simply put, when you absolutely need to reach all eyes with an urgent system notification, wall commands grab attention instantly on the channel users are actively working in.
Up next, let‘s look at sending customized wall messages from stored files instead of typing every time.
Broadcasting Messages from Files
Hardcoding repetitive messages on the command line is inefficient. Instead, you can store predefined template broadcasts in files and reuse them.
For example, to notify users of a regular backup schedules, just save the details in /admin/backup.msg:
Backup initiated!
User sessions may be disconnected without warning. Network performance will degrade between 12AM - 2AM daily. Schedule large data transfers accordingly.
Thank you for your patience!
Now sending the notice is a single command:
wall < /admin/backup.msg
You can build a library of preset messages covering regular events like:
- Maintenance downtimes
- Patching cycles
- Hardware upgrades
- Security lockdowns
Just script wall to send the appropriate file when your monitoring stack triggers the corresponding event!
Speaking of targeting specific groups, let‘s tackle that next.
Broadcasting to Groups
Spamming every single user with messages not relevant to them is distracting. The wall command supports targeting just members of a specific group who are logged in via the -g flag:
wall -g accounting The accounting application will be upgraded during the maintenance window tonight from 12AM onwards. Expect up to 30 minutes of disruption. Please save any work in progress before end of day.
This broadcasts the message only to users in the accounting group logged into terminals currently.
Make sure you have created the relevant groups like devops, developers, accounting beforehand. Segmenting critical notifications prevents overflowing inboxes and lets users focus.
Now that we‘ve covered targeting groups, let‘s see how to customize the default sysadmin header.
Suppressing the Wall Header
Every wall message comes with this header by default indicating the sender and timestamp:
Broadcast message from root@server01 (Wed Jan 11 16:37:01 2023):
You can suppress this prelude altogether with the -n flag if you wish to only display your message:
wall -n Attention! The system will now reboot for kernel upgrades. Expect a disconnect followed by a 15 minute downtime. Save work and logout if possible.
Users would now only see the condensed announcement:

I recommend always including the header to avoid confusion in case another sysadmin sends a simultaneous broadcast. But the option is there if you prefer trimmed down messages.
Up next, let‘s take a look additional capabilities available.
Additional Wall Command Options
Beyond what we‘ve covered so far, wall offers advanced capabilities through these options:
| Option | Description | Example |
|---|---|---|
-g group |
Send message only to the specified group | wall -g developers reaches just dev group |
-n |
Suppresses the sender and timestamp header | wall -n message |
-t tty |
Transmits only to the specified TTY | wall -t ttyS0 sends to just ttyS0 |
-V |
Prints wall version details | wall -V |
-h |
View brief help and usage | wall -h |
Fine-tuning delivery with the -t option let‘s you surgically notify individual consoles. And querying version details helps debug issues if you suspect problems with wall installations.
Now that we‘ve covered the wall command line in depth, let‘s explore some critical real-world use cases and best practices.
Critical Wall Command Use Cases
While wall replaces day-to-day emails and IMs reliably, it truly shines in these critical communication scenarios where reaching users is imperative:
- Planned Maintenance – Notify users of late night/weekend changes to minimize disruption to their work.
- System Upgrades – Alert to save work and logout before disruptive reboots for kernel, dependencies or app upgrades.
- Hardware Changes – Inform active sessions before altering server resources they utilize.
- Security Incidents – Request actions during ongoing attacks or policy violations to contain damage.
- Network Outages – If infrastructure like DNS, load balancers etc will be impacted, proactive notices help users plan.
During such events, directly reaching users via terminals guarantees visibility unlike asynchronous channels like email which are easy to miss.
Additionally, troubleshooting issues flagged by monitoring solutions and containing security breaches requires getting user cooperation in real-time which wall delivers.
Now let‘s move on to some best practices around constructing broadcast messages.
Wall Command Best Practices
Follow these guidelines when crafting effective wall messages:
- Be concise – Get to the point directly about the system event in clear, precise language.
- Indicate durations – Clearly specify both start and expected end times for maintenance windows, downtimes and other disruption.
- Send reminders – Follow up initial warnings with second and third reminders as the event gets closer.
- Suggest actions – Provide clear recommended actions like saving work, logging out etc.
- Review templates – Validate messages from files work as expected before sending to users.
- Consider impact – Limit messages to truly urgent events to prevent notification fatigue.
- Specify sender – Including the automated sender name/contact info helps users follow up if they have questions.
Adhering to these best practices helps ensure your mission-critical notices reach users reliably.
Now let‘s look at customizing wall behavior on a per-user basis.
Disabling Wall Messages Per User
While most users appreciate timely wall messages, some may find them distracting.
Power users can disable receiving wall broadcasts on their own terminals with the mesg n command:
mesg n
This opts them out from wall messages (and also talk requests).
To have wall messages enabled again, use:
mesg y
As the administrator, you can override these settings and force message delivery to a user with sudo:
sudo wall -T user1 backup in progress!
The -T flag ignores individual terminal message settings.
With great power comes great responsibility. So be judicious with forced overriding of personal notification settings.
Up next we tackle access controls around wall usage itself.
Securing Wall Command Usage
Unrestricted access to terminal broadcasts is dangerous – imagine random staff sending organization-wide hoax messages!
Here are some ways to secure wall usage:
Use sudo – Require sudo before all wall commands so only authorized sysadmins with sudo rights can run them.
Restrict access – Limit which accounts are even allowed sudo access to wall. Explicitly omit developers and other teams.
Create a special wallusers Unix group, add qualifying sysadmin accounts to it, then modify /etc/sudoers:
# Wall usage restriction
%wallusers ALL=(ALL) NOPASSWD: /usr/bin/wall*
Now only members of the wallusers group can execute wall sudo without passwords.
These controls enforce organizational broadcast policies and prevent confusion from unauthorized usage.
Up next, let‘s look at some advanced customization and integration options.
Advanced Wall Customization
Beyond command line flags, you can customize wall integration further:
Rate limiting – Use a systemd service unit to throttle maximum broadcasts to say 1 message per 30 minutes. This reduces disruption preventing spamming:
[Service]
Type=simple
ExecStart=/usr/bin/wall maintenance extended by 30 minutes
Restart=always
StartLimitInterval=30min
StartLimitBurst=1
Monitoring integration – Trigger wall messages from monitoring solutions like Prometheus Alertmanager by hooking into webhook endpoints.
Remote logging – Log all wall messages centrally or to a SIEM for auditing, reporting and compliance.
Custom headers – Modify wall source to prepend each message with tenant ID in multi-tenant environments or even ads!
Tying into other tools expands possibilities greatly. Next let‘s discuss responsible restraint with broadcasting.
Mindful Use of the Wall Command
Despite its usefulness, blasting every terminal has sparked criticism of enabling harassment and reducing productivity with unwanted disruption.
Some organizations restrict wall usage deciding consistent interruptions are unhealthy. Others require explicit opt-in from users to receive broadcasts.
As the administrator, thoughtfully assess if each proposed message truly warrants unsolicited highlighting to ALL staff. Does an entire organization need information about say…a developer tool outage?
Consider targeting only the subset of users impacted by system events. Marketing staff likely don‘t need every Kubernetes release update notification for instance.
Tasteful restraint messaging only when necessary avoids notification fatigue. Surely an hourly coffee break reminder could be broadcast…but should it?
Finally, let‘s wrap up with best practices for responsible wall usage.
Responsible Wall Command Usage – A Sysadmin Checklist
Here is a checklist covering key guidelines for effectively harnessing wall broadcasts:
🔸 Use wall commands judiciously for events causing wide-spread, time-sensitive disruption
🔸 Craft concise, clear messages with just the necessary details
🔸 Set message frequency throttles to prevent over-messaging
🔸 Send to targeted user groups to avoid distracting everyone
🔸 Store reusable notification templates in files for consistency
🔸 Secure access to wall with sudo group restrictions
🔸 Log/audit wall messages to central monitoring systems
Adhering to these principles ensures wall powers operations instead of introducing chaos!
Conclusion
The decades old wall Linux command remains a potent, highly effective tool in a system administrator‘s communication toolkit even in the modern era of real-time chat and video messaging.
Combining unconditional visibility, widespread terminal reach, reliability and urgency makes wall notifications impossible to overlook when you need to grab attention fast.
Mastering crafting broadcast messages, strategically targeting groups, integrating monitoring and keeping users in control puts the wall command firmly on your side.
So tap into its raw interrupting might, but temper wall‘s abilities with wisdom. Use it judiciously to delight users, never torment them!
With great power comes great responsibility. Wield your wall spells for good!


