write - macOS


Overview

The write command is an essential macOS tool for sending brief messages to other users on your local network. It’s commonly used to quickly communicate notes, reminders, or requests without interrupting someone’s workflow.

Syntax

write username [message]

Required arguments:

  • username: The username of the recipient on the local network.

Optional argument:

  • message: The message you want to send. If omitted, the system editor will open for you to compose the message.

Options/Flags

None.

Examples

Send a simple message:

write john Hello, can you join the meeting at 2pm?

Send a message from a file:

write jane < message.txt

Use the system editor to compose a message:

write bob

Common Issues

  • Recipient offline or not logged in: The message will not be delivered until the recipient logs in.
  • Message too long: The message will be truncated to 512 characters.

Integration

The write command can be integrated with other macOS commands through scripting. For instance, you could use it in a script to automate sending messages to multiple users.

  • wall: Send a message to all logged-in users.
  • mesg: Control whether you will receive write messages.
  • talk: Initiate a text-based chat session with another user.
  • say: Converts text to speech and speaks it aloud.