Linux mesg command

Linux 命令大全Linux Command Reference

The Linux mesg command is used to set the write permission of the terminal.

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 Disallow other users from displaying messages directly on your screen.
  • y Allow other users to display messages directly on your screen.

Examples

Allow other users to send messages to the current terminal.

root's terminal

# mesg y //在这个终端设置允许发送消息

Other regular users' 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 命令大全Linux Command Reference

Other extensions