1.首先檢視當前賬戶
[hadoop@weekend01 ~]$ who
hadoop tty1 2016-11-14 09:31 (:0)
hadoop pts/0 2016-11-14 09:32 (:0.0)
hadoop pts/1 2016-11-14 09:35 (:0.0)
hadoop pts/2 2016-11-14 09:35 (:0.0)
hadoop pts/3 2016-11-14 09:35 (:0.0)
hadoop pts/4 2016-11-14 09:35 (:0.0)
hadoop pts/5 2016-11-14 09:35 (:0.0)
hadoop pts/6 2016-11-14 09:35 (:0.0)
查詢每個使用者最近登陸時間lastlog
username port from latest
root pts/7 192.168.1.119 wed nov 9 12:57:40 +0800 2016
2.向所有使用者廣播一跳訊息
[hadoop@weekend01 ~]$ wall "hello,everyone i am sishen,what's your name?"
broadcast message from hadoop@weekend01 (pts/0) (mon nov 14 10:01:59 2016):
hello,everyone i am sishen,what's your name?
[hadoop@weekend01 ~]$
broadcast message from hadoop@weekend01 (pts/0) (mon nov 14 10:01:59 2016):
hello,everyone i am sishen,what's your name?
這樣pts/0到pts/6都可以收到這條訊息
3.向指定使用者傳送訊息,使用write命令
[hadoop@weekend01 ~]$ who
hadoop tty1 2016-11-14 09:31 (:0)
hadoop pts/0 2016-11-14 09:32 (:0.0)
hadoop pts/1 2016-11-14 10:08 (:0.0)
hadoop pts/2 2016-11-14 10:08 (:0.0)
hadoop pts/3 2016-11-14 10:08 (:0.0)
hadoop pts/4 2016-11-14 10:08 (:0.0)
hadoop pts/5 2016-11-14 10:08 (:0.0)
hadoop pts/6 2016-11-14 10:08 (:0.0)
root pts/7 2016-11-14 10:08 (192.168.1.119)
root pts/8 2016-11-14 10:20 (192.168.1.119)
root pts/9 2016-11-14 10:19 (192.168.1.119)
root pts/10 2016-11-14 10:21 (weekend06)
[root@weekend06 ~]# ssh weekend01
[hadoop@weekend01 ~]$ write root pts/10
hello,i am sishen,what's your name?
[root@weekend01 ~]#
message from root@weekend01 (as hadoop) on pts/9 at 10:21 ...
hello,i am sishen,what's your name?
使用ctrl+d來結束對話
如果不想接收訊息可以使用
[root@weekend01 ~]# mesg n來關閉,這樣除了root之外的資訊就不會接收了
也可以使用
[hadoop@weekend01 ~]$ who
hadoop tty1 2016-11-14 09:31 (:0)
hadoop pts/0 2016-11-14 09:32 (:0.0)
hadoop pts/1 2016-11-14 10:08 (:0.0)
hadoop pts/2 2016-11-14 10:08 (:0.0)
hadoop pts/3 2016-11-14 10:08 (:0.0)
hadoop pts/4 2016-11-14 10:08 (:0.0)
hadoop pts/5 2016-11-14 10:08 (:0.0)
hadoop pts/6 2016-11-14 10:08 (:0.0)
[hadoop@weekend01 ~]$ echo "hello ,what are you doing?" >/dev/pts/3
[hadoop@weekend04 ~]$ hello ,what are you doing?
posted on 2016-11-14 10:34收藏
linux 終端下的詞典
1 google 的 translate shell 用法直接trans 即可可以翻譯長句子 安裝 apt install translate shell trans zh cn b 英譯漢 b brief 但很慢 2 sdcv全稱為stardict console version,是終端下的詞典。...
linux終端下快捷鍵
常用 複製為ctrl shift c 貼上為ctrl shift v tab 補全 ctrl a 開始位置 ctrl e 最後位置 ctrl k 刪除此處至末尾所有內容 ctrl u 刪除此處至開始所有內容 ctrl l 重新整理螢幕 ctrl c 殺死當前任務 視窗操作 shift ctrl t ...
linux終端下的顏色顯示
在命令列下也能產生五顏六色的字型和圖案,只需要加上一些顏色 例如 echo e 033 41 36m 紅底綠字 033 0m 其中41的位置代表底色,36的位置是代表字的顏色 那些ascii code 是對顏色呼叫的始末.033 m 033 0m 字背景顏色範圍 40 49 40 黑 41 深紅 4...