I use du -h --max-depth=1
all the time to determine the disk usage of the folders in my current directory, but my fingers always stumble over --max-depth=
.
The better way (which I learned thanks to explainshell.com):
du -hd 1
Some helpful variants:
# uses the Summarize flag to achieve something similar
# different though because it shows individual files (and sizes) at the current working directory, and does _not_ show hidden files or folders
du -hs *
# sorts asc by reported size
du -hd 1 | sort -h
# sorts asc by reported size, and excludes hidden folders
du -hd 1 | sort -h | grep -v "./\\."