Linux wall命令会将信息传给每一个 mesg 设定为 yes 的上线使用者(可以输入mesg,如果返回is yes就可以收到)。当使用终端登陆的时候,可以使用EOF (通常用 Ctrl+D)。所有人均可以使用该命令。
官方的定义为:
wall – send a message to everybody’s terminal.
所以wall应该是write all user’s teminal的缩写。
使用的方法为:
1
$ wall [-n] [ message ]
其中参数-n的含义为,修改显示的广播信息放松抬头,看示例即可明白。
这个命令的使用场景为如果需要升级维护系统,可以通过wall命令通知所有在线的用户。
如下:
1 2 3 4 5 6 7 8 9 10 11
$ wall Dear all, We want to make you aware that this weekend 12PM CST, there will be scheduled down time for approximately 6 hours. During this time we will add more capacity and software update to our infrastructure and service. Please save all your works and logoutfor safe. See you next week. Regards, Admin Ctrl+D #退出
所有登陆的终端都会收到这个消息:
1 2 3 4 5 6 7 8 9 10 11
Broadcast message from user@localhost (pts/4) (Mon Apr 18 22:02:22 2011):
Dear all, We want to make you aware that this weekend 12PM CST, there will be scheduled down time for approximately 6 hours. During this time we will add more capacity and software update to our infrastructure and service. Please save all your works and logoutfor safe. See you next week. Regards, Admin