write a message to login users through terminal

March 10th, 2007 mysurface Posted in Admin, Common, wall, who, write | Hits: 319978 | 43 Comments »

To write a message to users that have login, you can using the command write. But before that, you need to check who is login, and which terminal he is login to, use command who.

Let say you was unable to call your friend, maybe he forgot to bring his cellphone and you know he is login to a linux server doing something, and you have permission to ssh to that particular server, then you can write him a message.

First, type:

who

who will list of all user have login and and login to which terminal, you will see something like pts/0, pts/1.

Example output:

aizatto    pts/0        2007-03-10 02:21 (:0.0)

With the information, now you can write messages to the user aizatto.

write aizatto pts/0

After typing the command line above, you can start to type your messages. When you hit enter, you message will be send to that terminal. Terminate the write by ctrl+D.

You can cat a file and pipe to write command too.

cat memo.txt | write aizatto pts/0

You can broadcast your message to all login user with wall command. wall, write to all.

cat announcement.txt | wall

Or simply type wall, then start to write your message. For wall, the message will be send only after you hit ctrl+D. And the message will be send to all users that login including you.

43 Responses to “write a message to login users through terminal”

  1. it will be nice if u can include some sample on how recipient screen look like when get the message.

    ( am i asking too much ? :P )

  2. login to s particular server through ssh, give me access as well, I will do you a live demo :P

    Its that better ? :D

  3. Not all distibution can have write i belive
    let’s assume to do it other way, through dev…

    echo msg > /dev/pts/1
    cat /dev/pst/1

  4. me gusto mas el último post, muy efectivo y sale inmediatamente en la termina. Tnks!!

  5. sebastian: I am sorry, I couldn’t understand the language you are saying.

  6. i am new to linux but i learned lots of neat stuffs already. is it possible to write message via terminal still yet the other side is not opening the terminal? thank you!

  7. jan:
    No, the user has to login to the console.

  8. example of what you see:

    Message from foo@server.domain on pts/1 at 10:23 …
    wanna grab lunch? im starved!!!

  9. if I will done for message and exit what must key word

  10. turn:

    “Terminate the write by ctrl+D.”

  11. I’m using Damn Small Linux and cannot use this command. It needs installing does anyone know where I can get the packages?
    Thanks.

  12. Ricky:
    That is bsdmainutils package.

    bsdmainutils: /usr/bin/bsd-write

  13. Thanks for the quick reply;
    -bash: bsdmainutils:: command not found

    Shall I use apt-get instead?

    Update; I used apt-get install bsd-write. It trys to build the Dependency Tree it gets up to 5% and then it starts killing it and ending it.

    =] Thank you ever-so-much.

  14. Update: I got the apt-get working again and it cannot find the
    package. =] Thanks again.

  15. Ricky: Damn Small Linux uses apt-get? Oh that is new to me. May be you can try to

    apt-cache search write

    or

    apt-cache search bsd

    or any other keywords you can think off.

    FYI, I am using Ubuntu, maybe the package’s name is different from Ubuntu repo.

  16. Thank you; Yeah I installed it onto the system. Thanks again. :)

  17. hello tableton,
    echo to /dev/… requires write permission to that file.
    It is necessary to give write permission to /dev/pts/.. to all users to use this method

  18. thank u

  19. BuTHileemeque Says:

    best search engine google

  20. anyone know how to view some sort of history log of messages you have received from other users?

  21. Want it? ,

  22. HI, Thanks a lot, I learned few things…

  23. Through wall command i can broadcast message on server, but i wants to know that how to send message on a particular IP.

  24. Hi I need to sent the user name and the tty from a file do you know how to do it?
    example:
    the file contain: user099 pts/0
    and I’m using:
    echo “Message”| write (here is when I need to read the data from the file)

    anyideas??
    Thanks

  25. echo “jo” | write `cat file`

  26. i just want to know more about the command WALL
    ….
    just want to write on all user’s terminal ..
    i tried the command but it is asking for permissions

  27. Alu, Have to have perms for that program to run it, can’t broadcast a message without root privs I don’t think.. type man write and see… you can just do echo “wasssaaaa” |wall and that will broadcast the message wasssaaaa to everyone logged in.. If you want to chat them try using ytalk and the username ie: ytalk test

  28. nice post

  29. how to find.. who sent the broadcast message ?

  30. How do you send “clear” to the other user after the transmission has eneded?

  31. [...] example from Linux by Examples might [...]

  32. [...] write-a-message-to-login-users-through-terminal [...]

  33. Matematyka z plusem sprawdzian

  34. Hi there, I would like to subscribe for this web site to get hottest updates, so where can i do it please assist.

  35. sshed a system and i want to write on his terminal which he is using

  36. I rarely comment, but after reading through some
    of the responses on this page write a message to login users through terminal ? Linux by Examples.
    I do have some questions for you if you do not mind. Is it
    only me or do some of these remarks look like they are coming from brain dead folks?
    :-P And, if you are posting at other online social sites, I would like to keep up with you.
    Would you list of the complete urls of your shared pages like your twitter feed, Facebook page or linkedin profile?

  37. Terrific article! That is the kind of info that are meant to be shared across the web.
    Shame on the seek engines for now not positioning this put up higher!

    Come on over and seek advice from my site . Thank you =)

  38. I have recently started a site, the info you provide on this website has helped me tremendously. Thanks for all of your time &amp work. The achievements of an organization are the results of the combined effort of each individual. by Vince Lombardi. bgkaadabgkda

  39. Every weekend i used to go to see this web page,
    for the reason that i wish for enjoyment, since this this site conations in fact
    good funny information too.

    Have a look at my blog post :: Roofing Atlanta

  40. I don’t even know how I ended up here, but I thought this post was good.
    I do not know who you are but certainly you’re going
    to a famous blogger if you are not already ;) Cheers!

    my web-site :: ibs treatment for women

  41. Therefore it can be mentioned that with an categorisation of extremely usable business and exciting features, the Blackberry
    mobile phones have turn into all-in-1 entertainment gadget
    for the users.

    Look at my blog :: free 100 gems in dragon city (Fatima)

  42. Awesome article.

    my webpage – 24 hour ac repair Conshohocken PA

  43. Hi, I desire to subscribe for this website to obtain latest updates, so where can i do
    it please help out.

Leave a Reply