To check the swap usage and utilization on a Linux system, you can use the following command-line and graphical user interface (GUI) tools:
free
: The free
command displays information about the system's memory usage, including the total amount of swap space, the amount used, and the amount free. Here's an example of how to use free
:$ free -m
The -m
option tells free
to display the sizes in megabytes.
swapon
: The swapon
command displays information about the swap devices currently in use on the system. Here's an example of how to use swapon
:$ swapon -s
This will display the swap device name, size, and usage.
vmstat
: The vmstat
command displays information about the system's memory, swap, and CPU usage. You can use it to monitor the overall swap usage of the system. Here's an example of how to use vmstat
:$ vmstat