Bird
0
0

You want to automate a script that logs disk usage of /home daily in human-readable format, but only the total size. Which command is best?

hard📝 Application Q9 of 15
Linux CLI - Disk and Storage
You want to automate a script that logs disk usage of /home daily in human-readable format, but only the total size. Which command is best?
Adu -ah /home > /var/log/disk_usage.log
Bdu /home > /var/log/disk_usage.log
Cdu -c /home >> /var/log/disk_usage.log
Ddu -sh /home >> /var/log/disk_usage.log
Step-by-Step Solution
Solution:
  1. Step 1: Identify requirements

    Only total size, human-readable, append to log file daily.
  2. Step 2: Match command

    du -sh /home gives total size human-readable; >> appends output to log.
  3. Final Answer:

    du -sh /home >> /var/log/disk_usage.log -> Option D
  4. Quick Check:

    Total + human-readable + append = du -sh /home >> /var/log/disk_usage.log [OK]
Quick Trick: Use >> to append logs, not overwrite [OK]
Common Mistakes:
  • Using -ah lists all files
  • Overwriting log with single >

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes