write a message to login users through terminal
March 10th, 2007 mysurface Posted in Admin, Common, wall, who, write | Hits: 246580 | 31 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.







March 13th, 2007 at 10:25 pm
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 )
March 13th, 2007 at 11:09 pm
login to s particular server through ssh, give me access as well, I will do you a live demo :P
Its that better ? :D
March 26th, 2007 at 9:44 am
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
April 21st, 2007 at 5:47 am
me gusto mas el último post, muy efectivo y sale inmediatamente en la termina. Tnks!!
April 21st, 2007 at 10:39 am
sebastian: I am sorry, I couldn’t understand the language you are saying.
July 3rd, 2007 at 4:48 pm
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!
July 3rd, 2007 at 7:27 pm
jan:
No, the user has to login to the console.
September 7th, 2007 at 10:26 pm
example of what you see:
Message from foo@server.domain on pts/1 at 10:23 …
wanna grab lunch? im starved!!!
September 11th, 2007 at 9:40 pm
if I will done for message and exit what must key word
September 12th, 2007 at 2:35 pm
turn:
“Terminate the write by ctrl+D.”
October 13th, 2007 at 11:41 pm
I’m using Damn Small Linux and cannot use this command. It needs installing does anyone know where I can get the packages?
Thanks.
October 14th, 2007 at 2:05 am
Ricky:
That is bsdmainutils package.
bsdmainutils: /usr/bin/bsd-writeOctober 14th, 2007 at 8:08 pm
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.
October 14th, 2007 at 8:15 pm
Update: I got the apt-get working again and it cannot find the
package. =] Thanks again.
October 14th, 2007 at 11:08 pm
Ricky: Damn Small Linux uses apt-get? Oh that is new to me. May be you can try to
or
or any other keywords you can think off.
FYI, I am using Ubuntu, maybe the package’s name is different from Ubuntu repo.
October 15th, 2007 at 12:42 am
Thank you; Yeah I installed it onto the system. Thanks again. :)
October 16th, 2007 at 8:06 pm
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
June 18th, 2008 at 12:21 pm
thank u
October 4th, 2008 at 6:36 am
best search engine google
March 19th, 2009 at 11:47 pm
anyone know how to view some sort of history log of messages you have received from other users?
April 9th, 2009 at 3:29 am
Want it? ,
January 16th, 2010 at 4:06 pm
HI, Thanks a lot, I learned few things…
January 22nd, 2010 at 9:05 pm
Through wall command i can broadcast message on server, but i wants to know that how to send message on a particular IP.
July 6th, 2010 at 10:13 am
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
January 25th, 2011 at 6:42 pm
echo “jo” | write `cat file`
March 11th, 2011 at 7:48 pm
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
April 7th, 2011 at 3:49 am
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
June 12th, 2011 at 1:17 am
nice post
July 11th, 2011 at 10:15 pm
how to find.. who sent the broadcast message ?
October 3rd, 2012 at 1:55 am
How do you send “clear” to the other user after the transmission has eneded?
December 6th, 2012 at 8:02 am
[...] example from Linux by Examples might [...]