du command?du -sh /var/log on a Linux system. What does the output represent?du -sh /var/log
The -s option summarizes the total size of the directory, and -h makes the output human-readable (like KB, MB). So the output shows total disk usage of /var/log.
du -h --max-depth=1 /home/user. What will the output show?du -h --max-depth=1 /home/user--max-depth=1 limits how deep du reports.The --max-depth=1 option tells du to show sizes for the directory and its immediate children only, not deeper nested folders.
du command fail?du -h --maxdepth=1 /etc but get an error. What is the cause?du -h --maxdepth=1 /etcThe correct option is --max-depth with a hyphen. Using --maxdepth causes an unrecognized option error.
du -h --max-depth=1 /var lists sizes of /var and its immediate subdirectories. Sorting numerically in reverse order with sort -hr puts largest first. head -n 3 picks top three.
du -b compared to du -h?du -b /tmp and du -h /tmp. What is the difference in their outputs?-b means show size in bytes (exact count). -h means human-readable format with units like KB, MB, GB for easier reading.
