du

disk usage

du [options][tree]

Summarize disk usage by tree, recursively for directories.

--max-depth=ntotal for a directory (or file with --all) only if it is n or fewer levels below
--max-depth=0 is the same as --summarize
-s
--summarize
only a total for each tree
-c
--total
grand total of all trees specified
-B
--block-size=size
use byte sizeblocks
size an integer followed by an optional:
kB=1000, K=1024, MB=1,000,000, M=1,048,576, … G, T, P, E, Z, Y .
-k same as --block-size=1K
-b
--bytes
size in bytes
-h
--human-readable
sizes in human? readable format (e.g., 1K 234M 2G ragged right)
--si

-H

£ use powers of 1,000

 Symbolic links on the command line are followed, symbolic links in file hierarchies are not .

-a
--all
count all files, not just directories
-l
--count-links
count sizes multiple times if hard linked (i.e. multiple directory entries reference a single file).
-D
--dereference-args
dereference files that are symbolic links as if they were in this directory.
-L
--dereference
dereference all symbolic links
-S
--separate-dirs
do not include size of subdirectories
-x
--one-file-system
skip directories on different filesystems
-X file
--exclude-from=file
Exclude files that match any pattern in file.
--exclude=patternExclude files that match pattern.
-A Apparent size for compressed volumes or sparse files.
--help 
--version 

Directories are not necessarily listed in alphabetical order unless   | sort -k2   is appended to the command.

pattern is a shell pattern (not a regular expression).
? matches any one character,
* matches any string (composed of zero, one or multiple characters).

Example: *.o will match files ending in .o .

Exclude all files and subdirectories ending in .o (including the file .o ).

   du --exclude='*.o' 

Comparing trees on different volumes will produce different sizes if they use different allocation schemes.