Few interesting commands which can be used to send the messages on other terminal or network:
This command is used to broadcast a message on all terminals.
wall "Hello, message testing"
cat msg.txt | wall
This command is used to send message to a user & selected terminal of a user.
echo "Hello, message testing" | write rahul
echo "Hello, message testing" | write rahul pts/0
cat msg.txt | write rahul pts/0
write rahul pts/0 << EOF Hello, message testing EOF
echo command can also used to send messages on selected terminal.
echo "Hello, message testing" > /dev/pts/0
cat can also write on a selected terminal similar to echo command.
cat /dev/pts/0 Hello, message testing CTRL+D
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"
ssh <host> export DISPLAY=:0 && notify-send "Hello, message testing"
6 thoughts on “Message on Linux terminal”
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 ;)
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
simply type :
to have the current state.