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
查看
測試完成
歡迎大家給予寶貴的意見或者建議。
歡迎大家補充或者共享一些其他的方法。
感謝支持。
閱讀更多 程序員日常筆記 的文章