Linux mesg命令用于設置終端機的寫入權(quán)限。
將mesg設置y時,其他用戶可利用write指令將信息直接顯示在您的屏幕上。
mesg [ny]
參數(shù):
允許其他用戶發(fā)信息到當前終端。
root 的終端
# mesg y //在這個終端設置允許發(fā)送消息
其他普通用戶的終端:
$ write root pts/4 hello hello EOF //Ctrl+D 結(jié)束輸入
root 的終端 終端顯示
# Message from root@(cainiaoplus.com) (as hnlinux) on pts/5 at 14:48 ... hello EOF