Linux wall命令
man wall
DESCRIPTION
Wall sends a message to everybody logged in with their mesg(1) permission set to yes. The mes-sage can be given as an argument to wall, or it can be sent to wall's standard input. When using the standard input from a terminal, the message should be terminated with the EOF key (usually Control-D).
The length of the message is limited to 20 lines. For every invocation of wall a notification will be written to syslog, with facility LOG_USER and level LOG_INFO.
将讯息传给每一个 mesg 设定为 yes 的上线使用者。
当使用终端机介面做为标准传入时, 讯息结束时需加上 EOF (通常用 Ctrl+D)。
消息的长度限制为20行。对于每次调用wall,都会将通知写入syslog,其中包含设施LOG_USER和级别LOG_INFO。
使用权限:
所有使用者
语法:
wall [ message ]
补充:
tty:查看当前终端
w:查看登录的用户
echo "message" > /dev/终端
例如:
echo "hello,queen.Iam root" > /dev/pts/2
wall命令图解:
案例:
登录root、odysee、queen
Root用户
wall
hi I am root
Ctrl + D
Odysee用户
Queen用户
案例2:
将信息发给指定终端的用户
我们使用root发消息给queen
获取queen用户的tty
tty
echo "hello,queen.Iam root" > /dev/pts/2
查看
测试完成
欢迎大家给予宝贵的意见或者建议。
欢迎大家补充或者共享一些其他的方法。
感谢支持。
閱讀更多 程序員日常筆記 的文章