A UNIX Command
$bsd-write jeffrin 8 bsd-write: jeffrin is not logged in on 8 $bsd-write jeffrin tty8 bsd-write: jeffrin has messages disabled on tty8 $mesg y $bsd-write jeffrin tty8 bsd-write: jeffrin has messages disabled on tty8 $w 20:08:58 up 23 min, 3 users, load average: 0.02, 0.15, 0.16 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root tty1 19:46 22:18 0.35s 0.03s wpa_supplicant -iwlan0 -c /etc/wpa_ jeffrin tty8 :0 19:53 23:20 58.84s 0.09s x-session-manager jeffrin pts/0 :0.0 20:01 0.00s 0.30s 0.00s w $bsd-write jeffrin pts/0 Message from jeffrin@debian.BW on pts/0 at 20:09 ... hey ... worked ? hey ... worked ? EOF $
If the user you want to write to is logged in on more than one terminal, you can specify which terminal to write to by specifying the terminal name as the second operand to the write command. Alternatively, you can let write select one of the terminals - it will pick the one with the shortest idle time. This is so that if the user is logged in at work and also dialed up from home, the message will go to the right place.