Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

Wall command in Linux - DesignLinux

Oct 12 2020
designlinux 0 Comments
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 [email protected] (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 [email protected] (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.

Related

Tags: terminal, wall

Linux Tee Command with Examples

Prev Post

Bash if..else Statement

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 501
  • 606,251

DesignLinux.com © All rights reserved

Go to mobile version