In Unix, how do I send a brief interactive message to someone?
Using the msg command
On some Unix computers, you can send a quick message using
msg command. To send a message, enter:
msg username@host This is the message being sent
username@host with the address of the person to
which you want to send the message, and
This is the message
being sent with your message.
For example, to send the message "Hey Darth, do you have my
printouts?" to the user
firstname.lastname@example.org, at the Unix
msg email@example.com Hey Darth, do you have my printouts?
The following message will appear on your recipient's screen:
firstname.lastname@example.org: Hey Darth, do you have my printouts?
Your address would replace
Some Unix computers cannot receive
msg messages. At
Indiana University, most UITS hosts are not configured to
do so. Also,
msg is not installed on some hosts, and you
may need to use the
write command instead.
Using the write command
You can also use the
write command to send a message. This
command can send several lines of text to another user logged into the same
Unix computer. Here is an example of the
write fred Hey fred! Did you bring your homework with you? ^D
^D stands for
this to end the
Below is a sample of the output of
Message from email@example.com on ttyr2 at 14:13 ... I don't have my homework with me My dog ate it <EOF>
EOF stands for "End Of File" and signifies the end of the
message being sent.
Turning messages on and off
write commands won't work if a user
is refusing messages. The
mesg command will turn on or off
the ability to receive messages. To turn on messages, enter:
To turn off messages, enter:
At Indiana University, for personal or departmental Linux or Unix systems support, see At IU, how do I get support for Linux or Unix?
This is document acjl in the Knowledge Base.
Last modified on 2008-08-22.
- Fill out this form to submit your issue to the UITS Support Center.
- Please note that you must be affiliated with Indiana University to receive support.
- All fields are required.