Monday, September 15, 2008

How to send messages within a shell terminal in Linux ?

There are TWO(2) common methods that you can communicate and send messages between users in shell terminal in Linux. Most of the kernel is compiled with the package, i.e. wall and write.

Wall is a command to send message to everyone in the shell terminal, in the other word means broadcast the message.

( Refer Wall Manpage )

Example :

root@localhost:/# wall    ( press Enter )
Hello Testing...broadcast using wall
( Ctrl-D to broadcast )

Broadcast Message from josephlee@localhost
        (/dev/pts/2) at 22:21 ...

Hello Testing...broadcast using wall

Write is a command to send message to a specify user in the shell terminal. Normally you will also need "who" or "w" command to find out who is in the terminal.

( Refer Write Manpage )

Example :

write testuser    ( press Enter )
Testing 123...     ( Ctrl-D to send )

Message from josephlee@localhost on pts/2 at 22:26 ...
Testing 123...

No comments: