Notify active users about an upcoming maintenance window using the built-in terminal messaging tools. Identify active sessions, broadcast a message to all users, and send a targeted message to a specific TTY.
A scheduled maintenance window is about to begin. You need to alert everyone currently logged into the host, then notify a specific user that they still have an open session and should log off before the work begins.
This is the kind of quick comms you do right before a reboot, patch cycle, storage maintenance, or network change.
who and basic listing
with users.
wall.
write.
who
who is the preferred tool when you need to
target a specific session because it includes the TTY (for
example, pts/2).
devstudent pts/0 2025-07-19 08:31 (:0)
sysmon pts/1 2025-07-19 08:33 (10.0.0.15)
analyst pts/2 2025-07-19 08:34 (10.0.0.42)
users
users is a quick glance at who is logged in,
but it does not show TTYs, so it is weaker for targeted
messaging.
devstudent sysmon analyst
wall "System maintenance starts in 10 minutes. Please save your work."
wall writes to all logged-in terminals. Keep it
short, actionable, and time-bound.
Broadcast message from root@server01 (tty1) (Fri Jul 19 08:35:12):
System maintenance starts in 10 minutes. Please save your work.
write analyst pts/2
write targets one session, so the TTY must
match what you discovered in Step 1. After starting the
write session, type your message and press Ctrl+D
to send.
[write session open - type your message and press Ctrl+D to send]
Hi analyst, please log off before 08:45 for scheduled maintenance.
[Message sent]
who
: Shows logged-in users with TTY and source address (best for
targeted messages).
users
: Quick list of usernames currently logged in (no TTY info).
wall <message>
: Broadcasts a message to all logged-in terminals.
write <user> <tty>
: Sends a message to a specific user session; finish input
with Ctrl+D.