How to check resource usage on Linux?

In a Linux system, you can use the following commands to check resource usage:

  1. top command: displays real-time resource usage of each process in the system, including CPU usage, memory usage, number of processes, etc. Sort order and displayed columns can be configured as needed.
  2. The free command displays information about the system’s memory usage, including total memory, used memory, and free memory.
  3. vmstat command: displays system statistics such as virtual memory, processes, and I/O, including CPU usage, memory usage, and disk I/O.
  4. iostat command: displays the system’s disk I/O usage, including disk read/write speeds, disk queue length, and more.
  5. The netstat command displays the system’s network connection status, including TCP connections, UDP connections, inter-process communication, etc.
  6. sar command: display historical data on the system’s resource usage, including CPU usage, memory usage, disk I/O, etc.

Here are some common commands for checking resource usage, choose the appropriate one as needed.

bannerAds