Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

Wall command in Linux - DesignLinux

designlinux 0 Comments

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.

Usually, system administrators send messages to announce maintenance and ask users to log out and close all open programs. The messages are shown to all logged-in users with a terminal open. Users using a graphical desktop environment with no terminal open will not see the messages. Each user can control the write access to its terminal with the mesg utility. When the superuser invokes the wall command, all users receive the messages, no matter their mesg settings.

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:

message1_file.txt
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.

Feel free to leave a comment if you have any questions.

terminal

Related

Tags: terminal

Df Command in Linux (Check Disk Space)

Prev Post

How to Install Odoo (Open Source ERP and CRM) on CentOS 8

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
  • 3
  • 1,007
  • 609,455

DesignLinux.com © All rights reserved

Go to mobile version