Few interesting commands which can be used to send the messages on other terminal or network:
1. wall:
This command is used to broadcast a message on all terminals.
For e.g.:
wall "Hello, message testing"
or
cat msg.txt | wall
2. write:
This command is used to send message to a user & selected terminal of a user.
For e.g.:
echo "Hello, message testing" | write rahul
or
echo "Hello, message testing" | write rahul pts/0
or
cat msg.txt | write rahul pts/0
or
write rahul pts/0 << EOF Hello, message testing EOF
3. echo:
echo command can also used to send messages on selected terminal.
For e.g.:
echo "Hello, message testing" > /dev/pts/0
4. cat:
cat can also write on a selected terminal similar to echo command.
For e.g.:
cat /dev/pts/0 Hello, message testing CTRL+D
5. notify-send:
It can send the desktop notifications.
For e.g.: From gnome terminal,
notify-send "Hello, message testing"
From any terminal
export DISPLAY=:0 && notify-send "Hello, message testing"
From SSH,
ssh <host> export DISPLAY=:0 && notify-send "Hello, message testing"
What’s up friends, good article and fastidious urging commented at this place, I am actually enjoying by these.
What if a user is not logged in? WRITE says it cannot send unless the recipient is logged in :P
Thanks for the article ;)
Hmm, ;-)
That is Linux security :-P
Pingback: Send Message on Linux Terminal « CATATAN MAS BLACK !
Nice post. I learn something new and challenging on sites I stumbleupon on a daily basis.
It’s always exciting to read through articles from other authors and use something from their websites.
To use the command write, the user you’re writing to must allow other users to write on his terminal using the mesg command, like :
mesg y <– if you want to allow messages
mesg n
simply type :
mesg
to have the current state.