11

As all know, we can send broadcast message to all users on a Linux machine.

But how to send message only to the specific user?

For example:

#who

rodegc  pts/1        2015-05-04 04:23 (10.4.72.1)
dwwar   pts/3        2015-05-03 00:56 (10.4.72.2)
tzcsar  pts/5        2015-05-03 22:32 (10.4.72.6)
.
.
.
.
.

In this case how to send broadcast message only to the user rodegc?

FROM MAN PAGE:

 WALL(1)                       Linux User's Manual                      WALL(1)

 NAME
 wall -- send a message to everybodyגs terminal.

 SYNOPSIS
 wall [-n] [ message ]

From the man page, I can't see any option to send to a specific user.

migrated from serverfault.com May 4 '15 at 8:37

This question came from our site for system and network administrators.

  • 1
    Also from the man page man wall: SEE ALSO mesg(1), talk(1), write(1), shutdown(8) . Similar or related tools are often mentioned in the See Also section. – Lambert May 4 '15 at 8:52
23

With write:

write <user> 
Some text goes here
CTRL-D (eof)

Alternative:

echo "Some text goes here" | write <user>

See man write.

  • Is there a way to prevent receiving writes? just in case an HILARIOUS coworker decides to yes | write badp – badp Jul 24 '17 at 11:40
  • 1
    Oh, that's mesg n – badp Jul 24 '17 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.