How to Use the wall Command on Linux

Linux terminal running on a laptopFatmawati Achmad Zaenuri /

Need a quick message to all connected users? Linux Wall Control is more powerful than email and automatically targets logged-in users. It broadcasts a message to anyone who uses a device on a system.

The wall commands

If you need to quickly send a message to connected users of your computer, how do you proceed? Email does not meet the requirements. You do not know when the email will be read. If you need people to know something right away, it does not cut your head. And anyway, you do not want to clutter the inboxes of disconnected users who do not need to see the message.

Without extra effort and wasting time, you will not know who is connected and from where. Your system could be located in Aberdeen, Washington but you can have remote users connected since Aberdeen, Scotland. So, how can you target a message specifically about logged in users?

Linux and other Unix-like operating systems give you a simple way to do it. The wall control is like a punchy telegram. It will send a message to all users of the terminal and return it under their noses. Users can not miss it and you know they have it. You do not need to choose to open an application to see if they have a message waiting.

The delivery is as subtle as a facial cream pie.

Sending a message

The test machine on which this article was studied was installed with Fedora Linuxbut the wall command will behave exactly the same on the other distributions.

The only difference you might encounter is that some Linux distributions require the use of sudo as an option to send a message from a text file, while other distributions require that you always use sudo with wall. This is actually a difference between Linux distributions, not the operation of the wall command itself.

To send a message to all users, type wall, a space, and then the message you want to send. With Fedora Linux, you must use sudo.

sudo main printer wall offline until new order.

wall control in a terminal window

Your message will be sent to all users with an open terminal window.

Local users RIa and Tom receive the message, as does the remote user, Dick, who works on a computer running Ubuntu.

wall message to the local user Ria in a terminal window

wall message to the local user tom in a terminal window

wall message to a remote user in a terminal window

They all receive the message at the same time, and you do not wonder if they have seen it.

Sending a message from a file

You can prepare your message in a text file and store it ready to be sent. If you have a cycle of messages to repeat, you can create a library of predefined messages so that you do not have to re-enter them again and again.

The message in the text message.txt file was displayed in the terminal window with the cat command to make sure that it is fine of the one you want to send.

The message is then sent by passing the name of the text file to the wall command as a command line parameter:

chat message.txt
wall sudo message.txt

wall control used with a text file in a terminal window

As before, local users Ria and Tom (as well as all other users connected with an open terminal window) and the remote user Dick receive the message.

wall message to Ria in a terminal window

wall message to Tom in a terminal window

wall message to Dick in a terminal window

E-mail label

Since the wall command will send the message to all device users, regardless of the circumstances, receiving one can be overwhelming. The use of the wall control must be minimized and used only in case of real need. Otherwise, it will quickly become very irritating.

A wall message will affix to everything on the user's terminal. In fact, it will not crush anything – it will not change the text on which it fell – but it will obscure it. And this can be alarming for a user who does not know it.

Imagine that one of our local users is editing an important file in Vi, just as the wall message is being sent.

edit a file in vi in ​​a terminal window

The message comes in the middle of his file.

wall message marking a file in vi in ​​a terminal window

All our users need to do to restore the correct view of the file is to scroll through the file from one end to the other.

restored editing file in vi in ​​a terminal window

It is fairly easy to restore the display to such a state that the work can continue and the blood pressure to go back, but too many interruptions of this type will leave you with a large number of users.

So, as practical as the wall is, use it in moderation.

What about graphic desk users?

The wall command reaches everyone connected with an open terminal, but does not address those who use a graphical desktop environment without an open terminal window.

If someone uses a graphical desktop and a terminal window is open, they will see it in the terminal window, but that's it. Do not count on the wall to reach someone outside the terminal.

It's not subtle, but you can not deny that the message is well understood – in a traditional terminal environment.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.