Multiple choice technology operating systems

Command used to get the top 5 file / directory occupying more space.

  1. du | sort -r | head -5

  2. du | sort -nr | head -5

  3. du | sort -n | head -5

  4. du

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The du command estimates file space usage, sort -nr sorts this output numerically in reverse order so that the largest entries appear at the top, and head -5 limits the final output to the top five space-occupying files or directories in the system.