Which command shows current active swap spaces?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which command shows current active swap spaces?

Explanation:
To see which swap areas are currently in use by the kernel, look at the kernel’s view of swap in the system, exposed by /proc/swaps. Using cat (or any read) to display this file shows a table of all active swap spaces, including the file or device name, type, total size, and how much is used. This gives you the exact list of swap areas that are active right now, which is exactly what’s meant by current active swap spaces. Free -m provides a summary of total swap usage (how much is free and used) but not the individual swap devices or files. Swapon -a would enable all swap spaces listed in /etc/fstab, not display them. Swapon -s can show a list on many systems, but /proc/swaps is the direct, always-accurate source of the current swap table.

To see which swap areas are currently in use by the kernel, look at the kernel’s view of swap in the system, exposed by /proc/swaps. Using cat (or any read) to display this file shows a table of all active swap spaces, including the file or device name, type, total size, and how much is used. This gives you the exact list of swap areas that are active right now, which is exactly what’s meant by current active swap spaces.

Free -m provides a summary of total swap usage (how much is free and used) but not the individual swap devices or files. Swapon -a would enable all swap spaces listed in /etc/fstab, not display them. Swapon -s can show a list on many systems, but /proc/swaps is the direct, always-accurate source of the current swap table.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy