Write to users

Sometimes I have to bring down the server and would like to warn users. I can send email, but they might not read that until after I have already interrupted their work.

The "wall" command does that.

Login as root, type "wall" <ENTER, then whatever you want to say (multiple lines are OK), followed by <ENTER and then CTRL-D

Note that users may not see the message - if their screen updates before they notice this, they won't see it.

The length of the message will probably be limited to something less than 25 lines. You may be able to specify that you only want to write to a certain group; check the man/info page.

As root, you can just blast whatever you want to users terminal devices - not very friendly. At most places, somebody picks up the phone and does a loudspeaker announcement or sends email instead.

I suggest Unix for the Impatient as a good book for this sort of thing.

If it's an individual user, you can use "write" to tell them that you are shutting down their database or that they are locking a file you need to access and so on.

Users can use "write" to send messages to each other, too, although they can choose to block such messages by using "mesg no". People do that to avoid chatty folks messing up their screens. That won't stop a root user, though (and it's assumed you have good reason for the interruption)..

Here's what it looks like if I write myself with "write tony ttys001" (if I didn't have multiple teminal sessions going, I could just say "write tony", but that just picks the least idle tty, which might not be what I want):

Message from [email protected] on ttys003 at 09:45 ...
hello
 

New users think this is a chat session and they can just type back. It CAN work like chat, but I'd need to write back first:

$ write tony ttys003
 

After that, the users can chat back and forth. The man page on my Mac notes:


The traditional protocol for writing to someone is that the string `-o', either at the end of a line or on a line by itself, means that it's the other person's turn to talk. The string `oo' means that the person believes the conversation to be over.

Yeah.. I don't think many people are using this today :-)

Still, you might find it useful in some situations where you are working with someone remote at the command line and for some reason have no more convenient way to communicate. I wouldn't expect them to lnow about "-o", though!

oo


Got something to add? Send me email.





(OLDER) <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> Write to all users


1 comment



Increase ad revenue 50-250% with Ezoic


More Articles by

Find me on Google+

© Tony Lawrence







Tue Jul 30 22:20:13 2013: 12244   TonyLawrence

gravatar


Wall

"Is anyone there?"

------------------------
Kerio Samepage


Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us





Try not to become a man of success, but rather try to become a man of value. (Albert Einstein)

UNIX is simple. It just takes a genius to understand its simplicity. (Dennis Ritchie)







This post tagged: