vmstat

The vmstat command prints the system virtual memory statistics for Linux and Unix systems. vmstat prints information about system processes, memory, swap, I/O blocks, interrupts and context switches and the CPU activity. The most common command format is,

vmstat [delay [count]]

The optional delay parameter tells the time interval between periodic vmstat outputs.… Read more

Finding the free and used memory with the free command

Using the free command, the free and used memory in a Linux or Unix system can be found. The free command can be given from the command line as,

free

And the system responds with an output like,

             total    used     free  shared  buffers  cached
Mem:        960268  873136    87132       0    14652  168884
-/+ buffers/cache:  689600   270668
Swap:      2996116   95332  2900784

In the above output, the system has 960,268 kilobytes of total memory, which is less than the actual physical memory because the memory occupied by the kernel is not reported here.… Read more

ps command usage examples in Linux

The ps command gives information about processes on a Linux or Unix system. Our programs run as processes in the system. Also, for each installed package, there might be one or more processes. So, to find out what is happening in the system, the first instinctive action is to find out about processes running in the system by using the ps command.… Read more

Starting a network server after communication interface is up

If you have a program that communicates over the network interface, say, eth0 and you wish to start the program automatically after the system startup, you need to ensure that the program starts after the interface eth0 is up. For Linux systems using the Upstart process management daemon, this can be done by starting the program after the event net-device-up occurs for the interface eth0.… Read more