LinuxCommandLibrary

wall

Send a message to all logged-in users

TLDR

Send a message

$ wall [message]
copy

Send a message to users that belong to a specific group
$ wall [[-g|--group]] [group_name] [message]
copy

Send a message from a file
$ wall [file]
copy

Send a message with timeout (default 300)
$ wall [[-t|--timeout]] [seconds] [file]
copy

SYNOPSIS

wall [options] [file]

PARAMETERS

-n, --nobanner
    Suppress the standard banner information (username, tty, time) that usually precedes the message.

-t seconds, --timeout seconds
    Specify a timeout in seconds for writing to each user's terminal. This prevents wall from hanging indefinitely if a terminal is unresponsive.

-g group, --group group
    Restrict the broadcast message only to users who are logged in and belong to the specified system group.

--help
    Display a help message and exit.

--version
    Output version information and exit.

file
    Read the message to be broadcast from the specified file. If omitted, wall reads from standard input.

DESCRIPTION

The wall (write all) command sends a message to every user currently logged into the system. It reads the message from standard input until an End-Of-File (typically Ctrl+D) is encountered, or from a specified file. This command is primarily used by system administrators for broadcasting important announcements, such as system shutdowns, urgent warnings, or general information to all active users. Messages appear directly on the users' terminal screens, interrupting whatever they are doing. Due to its intrusive nature, it requires appropriate permissions, usually root privileges, to be effective across all user terminals, especially if users have disabled message reception using the mesg n command.

CAVEATS

Messages sent by wall are broadcast to all logged-in users, including those on virtual consoles or graphical terminal emulators. Exercise caution and consider the privacy implications when sending messages. The command often requires root privileges or appropriate group membership (e.g., 'tty') to override user mesg n settings. Messages might be truncated if they are excessively long or if the receiving terminal has limitations.

While wall is effective for broadcasting to active terminal sessions, it will not reach users who are only connected via non-interactive sessions (e.g., SSH without a PTY, or GUI users without an open terminal window).

MESSAGE RECEPTION CONTROL

Users can control whether they receive messages from commands like wall and write by using the mesg command. mesg n disables message reception, while mesg y enables it. However, wall, when run by the superuser (root) or with appropriate permissions (e.g., SUID root), can bypass this setting for critical system broadcasts.

PERMISSIONS

To send messages to all terminals, including those where mesg n is set, wall typically needs to be executed with root privileges or be installed as a SUID (Set User ID) root executable. This ensures that critical system announcements can always reach users regardless of their personal message reception settings.

HISTORY

The wall command has been a fundamental utility in Unix-like operating systems for decades, tracing its roots back to early Unix versions. It serves as a simple yet powerful tool for system administrators to communicate instantly with all active users. Its functionality is often integrated into system shutdown and reboot procedures to notify users of impending system state changes, making it a critical component of system management and user communication on multi-user systems.

SEE ALSO

write(1), mesg(1), talk(1), who(1)

Copied to clipboard