← 返回列表

Linux shell mesg 命令

Linux shell mesg 命令用于设置终端机的写入权限。 将 mes g设置y时,其他用户可利用 write 指令将信息直接显示在您的屏幕上。 mesg 命令语法格式 mesg [ny] 选项 n 不允许气筒用户将信息直接显示在你的屏幕上。 y 允许气筒用户将信息直接显示在你的屏幕上。 范例 1. 允许其他用户发信息到当前终端 允许其它用户发信息到 root 的终端 [root@localhost ~] # mesg y #在这个终端设置允许发送消息 2. 其他普通用户的终端: [yufei@localhost ~]$ write root pts/4 hello hello EOF # Ctrl+D 结束输入 3. root 的终端 终端显示 [root@localhost ~]# Message from root@localhost on pts/5 at 18:52 ... hello EOF 返回上一级

Linux shell mesg 命令用于设置终端机的写入权限。

将 mes g设置y时,其他用户可利用 write 指令将信息直接显示在您的屏幕上。

mesg 命令语法格式

mesg [ny]

选项

n 不允许气筒用户将信息直接显示在你的屏幕上。 y 允许气筒用户将信息直接显示在你的屏幕上。

范例

1. 允许其他用户发信息到当前终端

允许其它用户发信息到 root 的终端

[root@localhost ~] # mesg y    #在这个终端设置允许发送消息

2. 其他普通用户的终端:

[yufei@localhost ~]$ write root pts/4 
hello
hello
EOF    # Ctrl+D 结束输入

3. root 的终端 终端显示

[root@localhost ~]# 
Message from root@localhost on pts/5 at 18:52 ...
hello
EOF

返回上一级

打开资源 ↗

交流与评论