CompTIA Linux+ (XK0-004) — Question 131
A Linux administrator tried to copy files to a remote server but received an error message indicating a lack of free space on the disk. The administrator issued a df command and verified adequate free space and inodes on the filesystem.
Which of the following commands is the BEST way to diagnose the issue?
Answer options
- A. cat /proc/meminfo
- B. lsof -nP | grep deleted
- C. find / -type f -size +50M
- D. du -a / | sort -n -r | head -n 30
Correct answer: B
Explanation
The correct answer is B because the command 'lsof -nP | grep deleted' lists open files that have been deleted but are still consuming disk space, which could explain the disk space error. Option A is irrelevant as it checks memory information, not disk space. Option C searches for large files but does not address the issue of deleted files, and Option D shows the largest directories or files but does not help in identifying hidden disk usage from deleted files.