Linux offers a variety of means for sending messages to users logged on to a server as explained in the two methods below.

 

In the first method, we will use wall command, write a message to all currently logged in users on the terminal as shown.

# wall "System will go down for 2 hours maintenance at 23 PM"

 

To disable the normal banner printed by the wall, for example:

Broadcast message from root@rootadminz (pts/2) (Tues May  8 23:10:45 2018):

 

Add the -n (Suppress the banner) flag, this however, can only be used by the root user.

# wall -n "System will go down for 2 hours maintenance at 23 PM" 

 

In the second method, we will use write command, which comes pre-installed on all if not most Linux distributions. It allows you to send a message to another user in the terminal using tty.

 

First check the all logged on users with the who command as shown.

$ who

 

There are currently two users are active on the system (rootadminz and root), now the user aaronkilik is sending a message to the root user.

$ write root pts/2 #press Ctrl+D  after typing the message. 

 

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket