write

write

Tutorial

傳送訊息給另一個 shell

1
2
3
4
5
write <user name> <pts number>

<message> (will send after Ctrl + D)

< Ctrl + D >

Example

1
2
3
4
5
6
7
[lucian-vm@:~/Desktop]$ w
21:39:51 up 13:48, 4 users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
lucian-vm tty2 tty2 Mon19 2days 0.06s 0.06s /usr/libexec/gnome-session-binary --systemd --session=ubuntu
lucian-vm pts/0 192.168.6.2 Mon19 7.00s 0.14s 0.13s screen -S test
lucian-vm pts/1 :pts/0:S.0 Mon19 7.00s 0.02s 0.00s w
lucian-vm pts/2 :pts/0:S.1 Tue22 15.00s 0.06s 0.06s /bin/bash

第一個傳送 shell (pts/1)

1
2
3
[lucian-vm@:~/Desktop]$ write lucian-vm pts/2
Hello
< Ctrl + D >

第二個接收 shell (pts/2)

1
2
3
4
[lucian-vm@:~/Desktop]$
Message from lucian-vm@lucianvm-virtual-machine on pts/1 at 21:44 ...
Hello
EOF
Author

Meow Lucian

Posted on

2022-06-23

Updated on

2022-07-04

Licensed under

Comments