Communicating with Users
The commands discussed in this section are simple and familiar to most Unix users. For this reason, they’re often overlooked in system administration discussions. However, I believe you’ll find them to be an indispensable part of your repertoire. One other important communications mechanism is electronic mail (see Chapter 9).
Sending a Message
A system administrator frequently needs to send a message to a
user’s screen (or window). write is
one way to do so:
$ write
username[tty]where username indicates the user to whom
you wish to send the message. If you want to write to a user who is logged in more than
once, the tty argument may be
used to select the appropriate terminal or window. You can find out
where a user is logged in using the who command.
Once the write
command is executed, communication is established between your
terminal and the user’s terminal: lines that you type on your terminal
will be transmitted to him. End your message with a CTRL-D. Thus, to
send a message to user harvey for which no reply
is needed, execute a command like this:
$write harveyThe file you needed has been restored.Additional lines of message text^D
In some implementations (e.g., AIX, HP-UX and Tru64), write may also be used over a network by
appending a hostname to the username. For example, the command below
initiates a message to user chavez on the host
named hamlet:
$ write chavez@hamletWhen available, the rwho command may be used to list all users on the local ...
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.
Read now
Unlock full access