[email protected]Office hours: Mon – Fri 9:00AM – 5:00PMLinkedInXFacebook
NexonHost
Netherlands Dedicated ServersAmsterdam · Equinix AM6Germany Dedicated ServersFrankfurt · Equinix FR4Romania Dedicated ServersBucharest · VoxilityAustria Dedicated ServersVienna · Interxion VIEBulgaria Dedicated ServersSofia · TelepointFrance Dedicated ServersParis · Interxion PAR — Marseille · Digital Realty MRS3Ireland Dedicated ServersDublin · Equinix DB2Italy Dedicated ServersMilan · Irideos AvalonPoland Dedicated ServersWarsawSpain Dedicated ServersMadrid · Equinix MD2United States Dedicated ServersAshburn · Equinix DC
All articles
Getting startedAugust 14, 2023

How to use wall command.

How to use wall command.

wall is a command-line utility that displays a message on the terminals of all logged-in users. The messages can be either typed on the terminal or the contents of a file. wall stands for write all, to send a message only to a specific user use the write command.

Broadcasting a Message

The syntax for the wall command is as follows:

wall [OPTIONS] [<FILE>|<MESSAGE>]

If no file is specified wall reads the message from the standard input.

The most straightforward way to broadcast a message is to invoke the wall command with the message as the argument:

wall "The system will be restarted in 10 minutes."
Broadcast message from [email protected] (pts/0) (Sun Oct  4 19:22:07 2020):

The system will be restarted in 10 minutes.

The message will be broadcasted to all users that are currently logged in.

To see all the logged-in users, run the w or who command.

To suppress the banner and show only the text you types to the logged-in users, invoke the command with the -n (--nobanner) option:
wall -n “The system will be restarted in 10 minutes.”

The system will be restarted in 10 minutes.

If you want to write multi-line messages, invoke the command without an argument:

wall

The wall command will wait for you to enter text. When you’re done typing the message, press Ctrl+D to end the program and broadcast the message.

You can also use the here-string redirection or pipe the output of another command to wall. Here is an example showing how to use the echo command to broadcast multi-line messages:

echo "The system will be restarted in 10 minutes. \nPlease save your work."  | wall

Broadcasting a Message From a File

If you are regularly sending the same messages, you can write each one of them to a file, so that you don’t need to re-type the same text. wall reads from the file only when invoked as root.

To broadcast the contents of a file, invoke the wall command followed by the file name:

The system will be restarted in 10 minutes.
wall message1_file.txt
Broadcast message from [email protected] (pts/0) (Sun Oct  4 19:25:06 2020):

The system will be restarted in 10 minutes.

Broadcasting a Message to a Group

To send a message only to members of a given group, run the command with the -g (--group) option, followed by the group name. For example, to write only on the terminals of the members of the “devs” group, you would run:

wall -g devs "The system will be restarted in 10 minutes."

The group can also be specified by its GID (group ID).

Conclusion

The wall command writes a message on the terminals of all currently logged-in users.

Keep reading
How to Implement Network Segmentation and Resource Isolation in Linux.
February 6, 2024

How to Implement Network Segmentation and Resource Isolation in Linux.

How to Implement Network Segmentation and Resource Isolation in Linux. Securing and managing networks in a Linux environment involves advanced practices like network segmentation and resource isolation. This guide explores these concepts, providing detailed instructions and examples for…

Read article
How to open or close ports in Linux.
February 6, 2024

How to open or close ports in Linux.

How to open or close ports in Linux. Effectively managing ports on your Linux system is crucial for both security and service accessibility. This comprehensive guide will provide a detailed walkthrough on opening and closing ports using the robust tools iptables and ufw. Understanding these…

Read article
How to use ypdomainname command.
January 23, 2024

How to use ypdomainname command.

How to use ypdomainname command. In the realm of Linux networking, the ypdomainname command plays a crucial role in the context of the Network Information Service (NIS). NIS, formerly known as Yellow Pages, is a distributed database service that facilitates the sharing of network configuration and…

Read article
Get in Touch

Together, Let’s Build a Faster, Safer Internet.

Build scalable infrastructure with NexonHost — high-performance dedicated servers, VPS hosting, colocation, and DDoS protection across Europe.

Get Started →Contact Us
[email protected]Office hours: Mon – Fri 9:00AM – 5:00PM