write

write sends a message to another user.

write user [tty]

Options

user The user to write to.
tty The specific terminal to write to, if the user is logged in to more than one session.

example

# write remoteuser pts/6
All Ok?

Typing the interrupt character (CTRL-C, by default) will return you to the command prompt, and end the write session.

 

 

 

First, type:

who

who will list of all user have login and and login to which terminal, you will see something like pts/0, pts/1.

Example output:

aizatto    pts/0        2007-03-10 02:21 (:0.0)

With the information, now you can write messages to the user aizatto.

write aizatto pts/0

After typing the command line above, you can start to type your messages. When you hit enter, you message will be send to that terminal. Terminate the write by ctrl+D.

You can cat a file and pipe to write command too.

cat memo.txt | write aizatto pts/0

You can broadcast your message to all login user with wall command. wall, write to all.

cat announcement.txt | wall

Or simply type wall, then start to write your message. For wall, the message will be send only after you hit ctrl+D. And the message will be send to all users that login including you.