Linux mesg Command
The Linux mesg command is used to set a terminal's write permission.
When mesg is set to y, other users can use the write command to display messages directly on your screen.
Syntax
mesg [ny]
Parameters:
- n Do not allow other users to display messages directly on your screen.
- y Allow other users to display messages directly on your screen.
Example
Allow other users to send messages to the current terminal.
root's terminal
# mesg y //Allows sending messages in this terminal
Another regular user's terminal:
$ write root pts/4
hello
hello
EOF //Ctrl+D 结束输入
root's terminal Terminal display
#
Message from root@w3cschool.cc (as hnlinux) on pts/5 at 14:48 ...
hello
EOF
Linux Command Reference