You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several ways to check swap space in Linux.
The free command with the -h tag shows the total, available, and used swap space in a human-readable format.
$ free -h
The /proc/meminfo file shows the total, free, and used swap space in kilobytes.
$ cat /proc/meminfo | grep Swap
The /proc/swaps file shows active swap devices.
$ cat /proc/swaps
The swapon command with the --show tag displays swap information. The output shows the active swap devices, including the path, file type, size, and usage.
$ swapon --show
To monitor swap space, use a monitoring tool such as the vmstat command.