CompTIA Linux+ (XK0-004) — Question 302
A system shows high utilization of swap space but low utilization of physical memory.
Which of the following commands should an administrator run to free up usable swap space?
Answer options
- A. mkswap ; swapon -a
- B. free && swapon -a
- C. swapoff -a && swapon -a
- D. swapon -a ; swapoff -a
Correct answer: C
Explanation
The correct answer is C because the 'swapoff -a' command disables all swap space, which frees it up, and then 'swapon -a' re-enables it, allowing the system to reclaim usable swap space. The other options either do not effectively free up swap space or are not appropriate commands for this purpose.