A system administrator needs to determine which process is using the most memory on a Linux server. Which command should be used to display processes sorted by memory usage?
Trap 1: top -o %MEM
top is interactive and not ideal for scripting.
Trap 2: vmstat 1 5
Shows system statistics, not per process memory.
Trap 3: free -m
Shows overall memory usage, not per process.
- A
top -o %MEM
Why wrong: top is interactive and not ideal for scripting.
- B
vmstat 1 5
Why wrong: Shows system statistics, not per process memory.
- C
ps aux --sort=-%mem
Correctly sorts processes by memory usage descending.
- D
free -m
Why wrong: Shows overall memory usage, not per process.