Updated: 22 October 2026 · Applies to: GNU coreutils du, any Linux distribution
The du (disk usage) command checks how much space files and folders are using on a Linux system. It takes several switches that are worth knowing; see man du or du --help for the full list. The most useful ones are below, each with a real example.
Most commonly used form
du -sch PATH combines three switches: s shows only the total size of the path (not every file inside it), h shows that size in a human-readable unit (K, M, G) instead of raw blocks, and c prints a grand total at the end.
root@server [/home/abl]# du -s /home/abl 213932 /home/abl root@server [/home/abl]# du -sh /home/abl 209M /home/abl root@server [/home/abl]# du -sch /home/abl 209M /home/abl 209M total
Listing every file and directory: switch "a"
du -ah PATH adds a, which lists the size of every individual file and directory under the path, not just the total.
root@server [/home/abl/etc]# du -ah /home/abl/etc | tail 0 /home/abl/etc/wis.com/quota 4.0K /home/abl/etc/wis.com 0 /home/abl/etc/ftpquota 0 /home/abl/etc/quota 4.0K /home/abl/etc/cacheid 0 /home/abl/etc/ablo.com/passwd 0 /home/abl/etc/ablo.com/shadow 0 /home/abl/etc/ablo.com/quota 4.0K /home/abl/etc/ablo.com 28K /home/abl/etc
Excluding a name from the output: --exclude
--exclude="PATTERN" leaves out any file or directory whose name matches the pattern. The example below excludes everything named quota.
root@server [/home/abl/etc]# du -ah --exclude="quota" /home/abl/etc | tail 4.0K /home/abl/etc/wis.abl.com 0 /home/abl/etc/wis.com/passwd 0 /home/abl/etc/wis.com/shadow 4.0K /home/abl/etc/wis.com 0 /home/abl/etc/ftpquota 4.0K /home/abl/etc/cacheid 0 /home/abl/etc/abl.com/passwd 0 /home/abl/etc/ablogsite.com/shadow 4.0K /home/abl/etc/ablogsite.com 28K /home/abl/etc
Showing modification time: --time
--time adds the last-modified date and time of each file or directory to the output.
root@server [/home/user/folder]# du -sch --time * 1.8M 2017-05-19 00:32 Folder 1 248M 2017-05-06 07:35 Folder 2 40K 2016-12-15 15:05 Folder 3 32K 2017-04-27 15:46 File.pdf 250M 2017-05-19 00:32 total
These switches cover the most common day-to-day uses of du. Run man du for the complete list of options.