Tuesday, November 20, 2007

how to send a message to a user on another Linux terminal

I've googled this several time already, but keep on forgetting the commands. Hope this note will help next time I try to search it again :)
Taken from here http://www.htmlforums.com/archive/index.php/t-64292.html

command write
http://www.linuxdevcenter.com/linux/cmd/cmd.csp?path=w/write
Initiate or respond to an interactive conversation with user. A write session is terminated with EOF. If the user is logged into more than one terminal, specify a tty number. See also talk; use mesg to keep other users from writing to your terminal.

command talk
http://www.linuxdevcenter.com/linux/cmd/cmd.csp?path=t/talk
Talk to another user. person is either the login name of someone on your own machine or user@host on another host. To talk to a user who is logged in more than once, use ttyname to indicate the appropriate terminal name. Once communication has been established, the two parties may type simultaneously, with their output appearing in separate windows. To redraw the screen, type Ctrl-L. To exit, type your interrupt character; talk then moves the cursor to the bottom of the screen and restores the terminal.

command mesg
http://www.linuxdevcenter.com/linux/cmd/cmd.csp?path=m/mesg
Change the ability of other users to send write messages to your terminal. With no options, display the permission status.

and of course wall
http://www.linuxdevcenter.com/linux/cmd/cmd.csp?path=w/wall
Write to all users. Depending on your Linux distribution, wall uses one of the two syntaxes shown. In both versions, the default is for wall to read a message from standard input and send the message to all users currently logged in, preceded by "Broadcast Message from..."

No comments: