User-to-user communication on multiuser Unix systems: Which command enables an immediate two-way text conversation with another user who is currently logged in (real-time messaging to a terminal)?

Difficulty: Easy

Correct Answer: write

Explanation:


Introduction / Context:
Unix is a multiuser operating system. Beyond email, it provides terminal-based tools for instant, interactive communication between logged-in users. Knowing which utility initiates a real-time two-way chat is essential for classic administration tasks and historical compatibility.



Given Data / Assumptions:

  • The recipient user is currently logged in and has not blocked messages.
  • The goal is immediate, interactive communication, not deferred mail.
  • Standard single-host terminals or pseudo-terminals are in use.


Concept / Approach:

The write command sends text directly to another user’s terminal. Once you start typing after invoking write username, your lines appear on their screen. They can respond by issuing write back to you, achieving two-way communication. The mesg command simply allows or denies such messages; it does not send them. mail sends asynchronous messages via the local mail system.



Step-by-Step Solution:

Choose the real-time terminal chat tool: write.Invoke as write user or write user tty to target a specific terminal.Recipient replies with write yourname to establish two-way conversation.End with Ctrl+D (EOF) to terminate the session.


Verification / Alternative check:

Check the recipient’s ability to receive with mesg: if mesg n is set, your write will be blocked. Switching to mesg y allows incoming messages. This confirms that write is the chat mechanism and mesg is the permission control.



Why Other Options Are Wrong:

  • mail: Asynchronous email delivery; not a live chat.
  • mesg: Toggles permission for receiving messages; does not send them.
  • grep: Searches text; unrelated to messaging.
  • None of the above: Incorrect because write is correct.


Common Pitfalls:

Forgetting to specify the correct TTY when a user has multiple logins; not checking mesg permissions; attempting to use write across different hosts without appropriate system support.



Final Answer:

write

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion