In Unix and Unix-like operating systems, is a utility used to send messages to another user by writing a message directly to another user's TTY.

History

The write command was included in the First Edition of the Research Unix operating system. A similar command appeared in Compatible Time-Sharing System.

Sample usage

The syntax for the write command is:

<syntaxhighlight lang="console">

$ write user [tty]

message

</syntaxhighlight>

The write session is terminated by sending EOF, which can be done by pressing Ctrl+D. The tty argument is only necessary when a user is logged into more than one terminal.

A conversation initiated between two users on the same machine:

<syntaxhighlight lang="console">

$ write root pts/7

Hello!

</syntaxhighlight>

Will show up to the user on that console as:

<syntaxhighlight lang="console">

Message from root@wiki on pts/8 at 11:19 ...

Hello!

</syntaxhighlight>

See also

  • List of Unix commands
  • talk (Unix)
  • wall (Unix)

References