Tuesday, November 8, 2011

Messaging in Unix

First, you need to know who to message.  To get a list of online users, you could type:

~ : who
f52560   pts/26       2011-11-08 19:00 (10.10.30.116)
f66420   pts/28       2011-11-08 19:22 (10.10.30.107)
f51970   pts/31       2011-11-08 19:16 (10.10.30.104)
f57980   pts/32       2011-11-08 18:03 (10.10.30.105)
pbille   pts/36       2011-11-08 14:34 (10.10.30.170)
f49150   pts/37       2011-11-08 18:07 (10.10.30.102)
f56340   pts/42       2011-11-08 19:21 (10.10.30.101)
pbille   pts/44       2011-11-08 19:22 (10.10.30.170)
f57870   pts/40       2011-11-08 19:25 (10.10.30.110)
f53490   pts/45       2011-11-08 19:22 (10.10.30.106)
f55930   pts/46       2011-11-08 19:23 (10.10.30.108)
f57710   pts/47       2011-11-08 19:23 (10.10.30.112)
f56600   pts/49       2011-11-08 19:27 (10.10.30.111)
f56340   pts/50       2011-11-08 19:24 (10.10.30.101)
f54110   pts/51       2011-11-08 19:27 (10.10.30.113)


But the list you get, while it has usernames, doesn't have real names, and is not really useful if the username is something like f52560.  So, let's try this:

~ : finger
Login     Name               Tty      Idle  Login Time   Office     Office Phone
f49150    RICHARD LUJAN      pts/37         Nov  8 18:07 (10.10.30.102)
f51970    JONATHAN TAN       pts/31         Nov  8 19:16 (10.10.30.104)
f52560    JASON GROCE        pts/26         Nov  8 19:00 (10.10.30.116)
f53490    MARK TELLES        pts/45         Nov  8 19:22 (10.10.30.106)
f54110    NICHOL GOLSTON     pts/51         Nov  8 19:27 (10.10.30.113)
f55930    ALEXAND NIMLEY     pts/46         Nov  8 19:23 (10.10.30.108)
f56340    JUST RODRIGUEZ     pts/42      4  Nov  8 19:21 (10.10.30.101)
f56340    JUST RODRIGUEZ     pts/50         Nov  8 19:24 (10.10.30.101)
f56600    DAVI MCPHERSON     pts/49         Nov  8 19:27 (10.10.30.111)
f57710    DAVID SILVA        pts/47         Nov  8 19:23 (10.10.30.112)
f57870    GASP HERNANDEZ     pts/40         Nov  8 19:25 (10.10.30.110)
f57980    ANGEL M ANGULO     pts/32         Nov  8 18:03 (10.10.30.105)
f66420    Michael Respicio   pts/28         Nov  8 19:22 (10.10.30.107)
pbille    Paul Bille         pts/36   4:36  Nov  8 14:34 (10.10.30.170)
pbille    Paul Bille         pts/44         Nov  8 19:22 (10.10.30.170)
pbille    Paul Bille         pts/52         Nov  8 19:27 (10.10.30.170)


Now we get usernames and the actual name.  With this, we can try something like:

~ : write f52560
write a message here
(CTRL + D)


This will send a message to the specific user.  You can only send a message to one user at a time, and can send multiple lines of text.  Pressing the CONTROL key and the D key at the same time exits the message and brings you back to the command entry mode.

Now, for the fun one.  Broadcasting a message, so that EVERYONE on the server receives it.  Be careful, because this means EVERYONE!

~ : wall
This is a message to EVERYONE!
(CTRL + D)


Enjoy your firecrackers, kiddles!  Don't put out an eye!

-Jason

No comments:

Post a Comment