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"
Filed under: Linux Explore Tips & Tricks, Message on Linux terminal Tagged: cat, chat, echo, Linux hacks, Linux Howto, Linux Tips, Linux Tricks, message, notify-send, terminal, wall, write
