Which command shows swap devices currently enabled on the system?

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 swap devices currently enabled on the system?

Explanation:
Linux keeps track of active swap spaces in a procfs file, and reading that file shows exactly which swap devices are currently enabled. cat /proc/swaps reads this kernel state directly, listing each swap area with its path (the device or file), type, total size, current usage, and priority. This direct representation makes it the clearest way to see which swap devices the system is using right now. Other commands provide related information but not a direct list of the devices: swapon -s shows a summary of enabled swap areas, free -h reports overall memory and swap usage but not the specific devices, and top highlights usage metrics but not the swap devices themselves.

Linux keeps track of active swap spaces in a procfs file, and reading that file shows exactly which swap devices are currently enabled. cat /proc/swaps reads this kernel state directly, listing each swap area with its path (the device or file), type, total size, current usage, and priority. This direct representation makes it the clearest way to see which swap devices the system is using right now.

Other commands provide related information but not a direct list of the devices: swapon -s shows a summary of enabled swap areas, free -h reports overall memory and swap usage but not the specific devices, and top highlights usage metrics but not the swap devices themselves.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy