bsd-write
Send messages to another logged-in user
SYNOPSIS
write user [tty]
PARAMETERS
user
The username of the recipient. This is a mandatory parameter.
tty
Optional. Specifies the specific terminal device (tty) the user is logged in on. If omitted, write will send the message to all of the user's logged in terminals. To find the tty use 'w' or 'who'.
DESCRIPTION
The bsd-write command allows a user to send a message directly to another user's terminal. Unlike email, bsd-write provides immediate, real-time communication. It attempts to establish a direct communication channel with the recipient's current terminal session. This command is useful for quick, interactive exchanges.
bsd-write operates by opening the recipient's terminal and displaying the message directly on their screen. When invoked, the sender's terminal becomes connected to the recipient's. Communication flows bidirectionally until the sender types EOF or presses Ctrl+D. The recipient can then reply and communicate back in the same fashion until they also send EOF. If the target user has write permission disabled ('mesg n'), the message will be blocked, and the sender will receive a message informing them that communication is not permitted. It's a simple, direct, and often disruptive method for instant messaging on a multi-user system.
CAVEATS
bsd-write is disruptive; it directly interrupts the recipient's work. Users can disable messages with 'mesg n'. The utility does not work well in modern graphical terminal environments; more modern messaging systems should be preferred. Security: bsd-write can be used for social engineering purposes or to distract other users. Ensure its use is permitted by the system's policies.
MESSAGE TERMINATION
The message transmission concludes when the sender types the end-of-file character (usually Ctrl+D) or when the connection is terminated.
The recipient can respond in the same way.
ERROR HANDLING
If the specified user is not logged in, or if the target user has disabled message receiving using 'mesg n', write will display an error message and terminate. The sender receives feedback concerning why the message wasn't delivered.
MODERN ALTERNATIVES
While bsd-write is still available on many systems, consider using modern messaging tools like instant messaging applications or email for communication, as these are less disruptive and offer more features.
HISTORY
The write command has been a standard utility in Unix systems since its early days. It provided a basic method for real-time communication between users on the same system. Over time, other messaging tools and communication protocols emerged, reducing the prominence of write. bsd-write is a common implementation of the command, often found in BSD-derived systems and included in many Linux distributions.