Archive

Posts Tagged ‘Linux hacks’

Message on Linux terminal

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"

10 Linux super-hacks for Linux Administrator

August 28, 2009 Leave a comment

1. Run top in batch mode

top is a handy utility for monitoring the utilization of your system. It is invoked from the command line and it works by displaying lots of useful information, including CPU and memory usage, the number of running processes, load, the top resource hitters, and other useful bits. By default, top refreshes its report every 3 seconds.

Top

Most of us use top in this fashion; we run it inside the terminal, look on the statistics for a few seconds and then graciously quit and continue our work.

View Complete Topic

Follow

Get every new post delivered to your Inbox.