Home > Package & System Management > write

write: Send a message to another user

The write command is a utility that allows you to send a direct message to another user currently logged into the system. The text you input is displayed in real-time on the recipient's terminal, making it useful for simple one-on-one communication.

Overview

The write command is used to send text messages to a specific user logged into the same system. All lines entered by the user are output directly to the recipient's terminal until the user presses Ctrl+D or the write session ends.

Key Features

  • Real-time one-on-one messaging
  • Direct output to the target user's terminal
  • A simple and immediate communication tool

Key Options

The write command controls its behavior using arguments rather than traditional option flags.

Arguments

Generated command:

Try combining the commands.

Description:

`write` Executes the command.

Combine the above options to virtually execute commands with AI.

Usage Examples

Various ways to use the write command to send messages to other users.

Sending a message to a specific user

write john
Hello John, are you there?
Let's meet at 3 PM.
^D

The most basic usage, sending a message to a user named 'john'. After executing the command, type your message and press Ctrl+D to complete the transmission.

Sending a message to a specific terminal

write jane pts/0
Hi Jane, please check pts/0.
^D

When a user named 'jane' is logged into multiple terminals (e.g., pts/0, pts/1), this sends a message to a specific terminal, in this case 'pts/0'.

Entering and exiting a message

write user_name
This is the first line.
This is the second line.
^D

After executing the write command, you can enter your desired message across multiple lines. To finish entering the message, press Ctrl+D on your keyboard. This signifies the end of the file (EOF) and completes the message transmission.

Tips & Considerations

Although the write command is simple, there are a few points to note and useful tips.

Usage Tips

  • Exit with Ctrl+D: You must press Ctrl+D to finish entering your message. Otherwise, the write session will remain open.
  • mesg command: You can control whether other users are allowed to send you write messages. 'mesg y' allows message reception, and 'mesg n' denies message reception. You can check the current status by simply typing 'mesg'.
  • wall command: To broadcast a message to all logged-in users, use the wall command instead of write. wall is useful for system administrators to convey announcements.

Considerations

  • Security and Privacy: write transmits messages in plain text without encryption, and they are displayed directly on the terminal, making it unsuitable for sending sensitive information. Furthermore, the messages are exposed as-is on the recipient's terminal.
  • Legacy Tool: Compared to modern messaging systems (e.g., chat apps, email, SSH-based communication), write has limited functionality and is used less frequently. It is primarily used for simple notifications or testing purposes between users logged into the same server.

Same category commands