Sending messages to user terminals
A system administrator may need to send messages to the terminal of every user or a specified user on all the machines over a network. This recipe is a guide on how to perform this task.
Getting ready
wall
is a command that is used to write messages on the terminals of all logged in users. It can be used to convey messages to all logged in users on a server or multiple access machines. Sending messages to all users may not be useful at all times. Terminals are treated as devices in a Linux system and hence, these opened terminals will have a corresponding device node file at /dev/pts/
. Writing data to a specific device will display messages on the corresponding terminal.
How to do it...
In order to broadcast a message to all users and all logged in terminals, use:
$ cat message | wall
Or:
$ wall< message Broadcast Message from slynux@slynux-laptop (/dev/pts/1) at 12:54 ... This is a message
The message outline will show who sent the message (which...