APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Write to users

© July 2013 Tony Lawrence

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 tony@Anthonys-iMac.local on ttys003 at 09:45 ...

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!


Got something to add? Send me email.

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

Printer Friendly Version

-> Write to all users

1 comment

Inexpensive and informative Apple related e-books:

Take Control of iCloud

iOS 8: A Take Control Crash Course

Sierra: A Take Control Crash Course

Take Control of Preview

Take Control of Pages

More Articles by © Tony Lawrence

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



"Is anyone there?"


Printer Friendly Version

Have you tried Searching this site?

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

Printer Friendly Version

A learning experience is one of those things that say, "You know that thing you just did? Don't do that." (Douglas Adams)

Linux posts

Troubleshooting posts

This post tagged:





Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode