Skip to Content
Linux Shell Scripting Cookbook - Third Edition
book

Linux Shell Scripting Cookbook - Third Edition

by Clif Flynt, Sarath Lakshman, Shantanu Tushar
May 2017
Beginner
552 pages
28h 47m
English
Packt Publishing
Content preview from Linux Shell Scripting Cookbook - Third Edition

Sending a message to all users

The wall (WriteALL) command broadcasts a message to all the users and terminal sessions:

    $ cat message | wall

Or:

    $ wall < message
    Broadcast Message from slynux@slynux-laptop
            (/dev/pts/1) at 12:54 ...

    This is a message

The message header shows who sent the message: which user and which host.

The write, talk, and wall commands only deliver messages between users when the write message option is enabled. Messages from the root are displayed regardless of the write message option.

The message option is usually enabled. The mesg command will enable or disable the receiving of messages:

    # enable receiving messages
    $ mesg y
    # disable receiving messages
    $ mesg n
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Linux Shell Scripting - Second Edition

Mastering Linux Shell Scripting - Second Edition

Mokhtar Ebrahim, Andrew Mallett

Publisher Resources

ISBN: 9781785881985