linux write
时间: 2023-10-02 18:10:18 浏览: 40
The `write` command in Linux is used to send messages to other users who are logged in to the same system or to a specific user by specifying their username. The syntax of the `write` command is as follows:
```
write [username] [terminal]
```
Here, `username` is the name of the user to whom the message is to be sent, and `terminal` specifies the terminal or console where the message is to be displayed. If `username` is omitted, the message is sent to all users who are currently logged in.
Once you enter the `write` command, you can type your message and press `Enter`. The message will be sent to the specified user or users and displayed on their terminal. You can end the message by pressing `Ctrl+D`.
For example, to send a message to a user named `john` on their terminal `tty1`, you would use the following command:
```
write john tty1
```
You can then type your message and press `Enter`. The message will be displayed on John's terminal.