write
Quick Reference
Command Name:
write
Category:
communication
Platform:
Linux/Unix
Basic Usage:
Common Use Cases
Syntax
write user [ttyname]
Options
The write command has minimal options compared to many other Linux commands. It primarily takes arguments rather than traditional options with dashes.
Argument | Description |
---|---|
user |
The username of the recipient |
ttyname |
Optional terminal name if the user is logged in on multiple terminals |
Interactive Mode
After executing the write command, you enter an interactive mode where:
- Each line you type is sent to the recipient when you press Enter
- The recipient sees your username, terminal, and timestamp with each message
- To end the session, press Ctrl+D or Ctrl+C
Examples
How to Use These Examples
The examples below show common ways to use the write
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
cat message.txt | write susan