Disable ads (and more) with a premium pass for a one time $4.99 payment
Using the command swapon -s
is specifically designed to display summary information about the swap space currently in use on a Linux system. When executed, it provides an overview of the active swap devices and their respective sizes, used space, and priority. This information is crucial for monitoring the system's memory management, especially when assessing performance or troubleshooting.
In contrast, while the lsblk
command does provide information about block devices, including swap space, it is not exclusive to swap and offers a broader view of all block devices present on the system. The df -h
command shows disk space usage but is primarily focused on mounted filesystems rather than specifically highlighting swap usage. Meanwhile, top
is a dynamic task manager that displays real-time system performance statistics, including memory usage, but does not present a focused summary of swap space like swapon -s
.
Thus, the specific functionality provided by swapon -s
makes it the most appropriate choice for verifying the current swap space on a Linux system.