Why doesn't this show the hidden files/folders?

Use

du -sch .[!.]* * |sort -h

in your home folder.

Alternatively, the command I use most frequently is

ncdu

Easy to install if needed:

sudo apt-get install ncdu

I have same question in coreutils mailing list, because it was hard to me to remember this weird command by @don.joey. And Bob Proulx proposed better, more natural command: du -ahd1 | sort -h

If you want to list all of the files in the current directory then either use '.' or don't give it any file arguments at all. Also you may want to use the -d, --max-depth=N option.

Try this:

du -hd1


When you run that same command inside the directory, it is not including the hidden files which start with . in the count. If you have Steam for example installed, it default to installing games under ~/.local/share/Steam/ and it itself is installed there as well.

Under bash you apparently need to run du -sch .[!.]* * as it does not properly expand the .* glob. Under zsh or other shells, du -sch * .* should work, as .* should be expanded to include the list of all hidden files in the current directory.

Tags:

Disk Usage