Posts Under Category: SSH

Tail is a very useful SSH command to read a file. Its like cat command but it only reads a file. Tail command by default will show last 20 lines of a file.

Example

tail /var/log/messages

This will show the last 20 lines of /var/log/messages

tail -f /var/log/messages

This will show last 20 lines of /var/log/messages and will also update while it’s being changed / updated.

tail -100 /var/log/messages

This will show the last 100 lines of /var/log/messages

How to exit from tail command

Simply press following key on your keyboard.

ctrl + c

Our Recommended Dedicated Server

Sometimes you may need to kill all process of a particular user. This can be done using following SSH command.

pkill -u username

The above SSH command will all process by user username. Like if you want to kill all process by user ravi, change username to ravi.

ssh-pkill

You can also use killall command to kill all processes of a user.

killall -u username

Our Recommended Dedicated Server

Use below SSH command to find detailed memory information / usage of your server / VPS. It will show you total memory, free memory, used memory, cached memory etc.

cat /proc/meminfo

This command is very useful as it shows large amount of valuable information about the server RAM usage, like:

  • Total usable RAM
  • Free memory
  • Buffer memory
  • Cached memory
  • Swap used as cache memory
  • Total cache memory that is active
  • Total cache memory that is free
  • Total amount of memory in the high region
  • The total amount of non-highmem memory.
  • The amount of free memory of the low memory region.
  • Total amount of physical swap memory.
  • Dirt: The total amount of memory waiting to be written back to the disk.
  • Writeback: The total amount of memory actively being written back to the disk.
  • etc..

ssh-proc

Another useful command

Another very good SSH command to find detailed memory information is:

vmstat -s

Our Recommended Dedicated Server

You can check the centOS version installed on your dedicated server / VPS using any of the following SSH command.

cat /etc/*release*

cat /etc/redhat-release

cat /etc/centos-release

centos-version

Our Recommended VPS Hosting

Top command in SSH is used to display top process using high CPU.

To exit from top, just press following key on your keyboard.

q

Our Recommended Dedicated Server