Cybersecurity Updates & Tools

wall Command in Linux: Broadcast Messages to Logged-In Users

The wall command in Linux sends a message to the terminals of all currently logged-in users. The name stands for “write all.” To send a message to a single specific user, use the write command instead.

System administrators use wall before planned maintenance, reboots, or shutdowns to give users time to save their work and log out.

How the wall Command Works in Linux

The syntax is:

bashwall [OPTIONS] [FILE|MESSAGE]

To broadcast a message, pass it as a quoted argument:

bashwall "The system will be restarted in 10 minutes."

Every logged-in user with an active terminal sees output like this:

Broadcast message from root@linuxize.host (pts/0) (Sun Oct 4 19:22:07 2020):The system will be restarted in 10 minutes.

The banner shows the sender’s hostname, the terminal device (TTY or PTS number), and the timestamp. To see all currently logged-in users before sending, run w or who.

Suppress the Banner, Multi-Line Messages, and File Input

Suppress the banner with -n. When the header clutters a formatted message or you are running wall from a script:

bashwall -n "The system will be restarted in 10 minutes."

Recipients see only the message text, with no header line.

Multi-line messages. Run wall without arguments and type interactively. Press Ctrl+D when done to send the EOF signal and broadcast:

bashwall

For scripts, pipe content through echo or use a heredoc to avoid interactive input:

bashecho "The system will be restarted in 10 minutes." | wallwall << EOFThe system will be restarted in 10 minutes.Please save your work and log out.EOF

Read from a file. Store a standard maintenance message in a plain text file and pass it to wall directly. This avoids re-typing the same message across repeated maintenance windows:

bashwall message.txt

Target a Group, mesg Permissions, and SSH Behavior

Send to a specific group with -g. The message reaches only members of that group who are currently logged in with an active terminal — not all group members, only those with an open session:

bashwall -g devs "Deploying to production in 5 minutes."

The group can be specified by name or GID.

mesg permissions. Each user controls write access to their own terminal device with the mesg command. Running mesg n blocks incoming messages from other users. When root runs wall, messages are delivered regardless — root has direct access to all terminal devices and is not subject to user mesg settings.

Graphical sessions. wall writes to TTY and PTS devices. Users logged into a graphical desktop without a terminal window open have no such device attached to their session and will not receive the broadcast.

SSH sessions. Users connected over SSH receive the message if their session has an interactive TTY. Non-interactive SSH sessions — such as those using -T or automated port-forwarding connections — do not.

Shutdown integration. The shutdown command sends a wall broadcast automatically before rebooting or powering off, so you rarely need to run both manually:

bashsudo shutdown -r +10 "Rebooting in 10 minutes."

The wall command is the standard tool for coordinating maintenance notifications across shared Linux systems. For single-user messaging, use write instead. Leave a comment below if you run into any issues.