• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

Wall command in Linux

Written by Admin, Updated On October 9, 2020
terminal, wall
Wall command in Linux

The wall is a command line tool used to show message on the terminals of all logged-in users. wall stands for write all. Generally, it is used by system administrators to announce of maintenance and further use. This guide covers the use of wall command in Linux.

The message sent using wall will display on the terminals of logged-in user and who have terminal open. In a response every user can write the message with the mesg utility.

Broadcasting a Message#

Following is the basic syntax of wall command:

wall [OPTIONS] [FILE|MESSAGE]

It is very simple to broadcast the message, invoke wall command followed by the message as an argument:

wall "The system will be reboot in 20 minutes."
Broadcast message from root@linuxize.host (pts/0) (Sun Oct  8 15:12:17 2020):

The system will be reboot in 20 minutes.

It will show the message to the all users who are currently logged in. You can check the currently logged-in users using w command.

Use the -n (--nobanner) option with wall to show only the text to the logged-in users:

wall -n "The system will be restarted in 10 minutes."
The system will be reboot in 20 minutes.

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

wall

It will hold until the text entered by you. Press Ctrl+D to end the program and broadcast the message.

You also can use the pipe or string redirection the output of another command to wall. Following the example of echo command to broadcast the multi-line message.

echo "The system will be reboot in 20 minutes. \nPlease close your all programs." | wall

Broadcasting a Message From a File#

If you frequently sending same messages, you can define it in separate file and you don’t have to type every time. wall command can read the file if you invoked as root.

Here is the example, how to broadcast the message of a file, run the wall command followed by file name:

wall msg_file.txt
Broadcast message from root@tecnstuff.dev (pts/0) (Sun Oct  8 17:18:06 2020):

The system will be reboot in 20 minutes.

Broadcasting a Message to a Group#

To send the message to a specific group members only, invoke the wall command with the -g (--group) option, followed by the group name.

For example, to broadcast message only to the members of the “tns” group, you would run:

wall -g tns "The system will be reboot in 20 minutes."

You also can specify the group id instead of name.

Conclusion#

Using the wall command you can send the message to all currently logged-in users.

If you have any questions or feedback, feel free to leave a comment below.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article Linux Tee Command with Examples
Next Article   Bash if..else Statement

Related Posts

  • How to Use sed to Find and Replace String in Files

    How to Use sed to Find and Replace String in Files

    December 18, 2020
  • Linux Head Command

    Linux Head Command

    December 16, 2020
  • Rename Files and Directories in Linux

    How to Rename Files and Directories in Linux

    December 15, 2020

Leave a Reply Cancel reply

Popular Posts

  • How to Install Python 3.9 on CentOS 8
    How to Install Python 3.9 on CentOS 8 December 31, 2020
  • How to Install Php 8 on Debian 10
    How to Install PHP 8 on Debian 10 January 2, 2021
  • How to Install Php 8 on Ubuntu 20.04
    How to Install PHP 8 on Ubuntu 20.04 December 28, 2020
  • How to Install GIMP on Debian 10
    How to Install GIMP 2.10 on Debian 10 December 27, 2020
  • How to Install GIMP 2.10 on CentOS 8
    How to Install GIMP 2.10 on CentOS 8 December 30, 2020
© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook