System
write
Send a message to another user's terminal.
messageuserterminaltalkcommunication
Additional Notes
write sends a text message directly to another user's terminal. The message appears on the recipient's terminal in real time, prefixed with a header showing the sender's username and terminal. The recipient can reply with their own write command, creating a two-way chat session terminated by Ctrl+D or Ctrl+C.
This command predates modern instant messaging and was commonly used on multi-user Unix systems for inter-user communication. It only works if the recipient has enabled mesg y (messages allowed). On systems with graphical desktops, users may not have a writable terminal.
Syntax
write user [terminal]
Parameters
user: The username of the recipient.terminal: If the user is logged in on multiple terminals, specify which one.
Examples
write alice
Hello Alice, the build is done.
^D
Send a message to alice on her current terminal. End with Ctrl+D.
write bob pts/1
Send to bob specifically on terminal pts/1.
Practical Notes
- The recipient must have messages enabled (
mesg y). Check withmesg. - Use
who -Tto see which users have messages enabled (+) or disabled (-). - If the recipient is not logged in or has messages disabled,
writereports an error. - For modern inter-user messaging, use
wall(write all),talk, or chat applications. - Press
Ctrl+CorCtrl+Dto end the message. - A
writesession is plain text only; no formatting or file transfer is supported.