I was looking through my system with du -sch ./* to find the big useless files I may have stockpiled with no reason, when I found this:

$ du -sch ./*
du: cannot read directory ‘./drbunsen/.gvfs’: Permission denied
du: cannot read directory ‘./drbunsen/.cache/dconf’: Permission denied
18G ./drbunsen
18G total

$ cd drbunsen/
$ du -sch ./*
601M ./Desktop
20K ./Documents
598M ./Downloads
4.0K ./flash
4.0K ./Music
8.0M ./Pictures
4.0K ./Public
4.0K ./Templates
4.0K ./Ubuntu One
8.0K ./Videos
11G ./VirtualBox VMs
6.9M ./workspace
12G total

How do I make hidden files visible? du -sch ./.* gives the same result as du -sch ./*.

  • du -hs .[^.]* * for all hidden files, excluding . and .. which other answers seem to be missing. – laggingreflex Apr 12 '15 at 14:12
  • Not enough rep here to answer this highly active question, so a quick comment instead. If under bash, you can "fix" this by using the dotglob shell option. I use a subshell here so that it does not affect globally for other commands => (shopt -s dotglob; du -shc *) – Zeitounator Nov 24 '20 at 15:44


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

in your home folder.

Alternatively, the command I use most frequently is


Easy to install if needed:

sudo apt-get install ncdu
  • 1
    Thanks, you are a genius. I am not a master in bash, what doe [!.] do? – Dr_Bunsen Oct 22 '13 at 14:43
  • 11
    @Dr_Bunsen: It's a glob that lists all the files that start with a single .. Here's a neat trick: if you don't know what a glob-looking thing does, try running echo .[!.]* or whatever. The shell will then expand the glob and pass it into echo, printing out the list of files that results. – Tikhon Jelvis May 21 '14 at 17:46
  • 15
    That fails to list files named like ..foo and may cause problems with files whose name starts with -. It could also fail if the arg list is too long. du -ahd1 would have none of those problems. – Stéphane Chazelas Jun 22 '15 at 20:08
  • 1
    Irrelevant to the original question, but relevant to day to day usage: It might be useful to include 'c' switch to display the total and to reorder the options a bit to make this command a little bit easier to remember: du -cksh .[!.]* * |sort -h. – Daddy32 Feb 21 '17 at 13:06
  • Nice glob. But this does only work if you actually have hidden files on the top level. Hidden files inside directories will still not be counted.And thnak you for ncdu. – Hinz Feb 19 at 8:23

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

  • 8
    Add the -a option for it to be equivalent. – Stéphane Chazelas Jun 22 '15 at 20:16
  • 7
    This should be the accepted answer because it's simpler and easier to remember and understand. – Bastien Sep 10 '15 at 8:47

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.

  • 1
    OK. There is apparently a problem with bash then, as it doesn't seem to properly expand .*. But du -sch * .* does do the correct thing under zsh. Under bash, du -sch .* seems to count . but doesn't expand to show files individually. – dobey Oct 22 '13 at 13:39
  • For me .* also expands to ../* and therefore du goes out of the directory that I want to see its size! I had to use ./.[^.]* instead. – Ari Sep 19 '14 at 22:58
  • It's zsh and all the shells derived from the Forsyth shell (nowadays that's mostly only pdksh and its derivatives) that do the right thing and don't expand . and .. here. All the other Bourne-like shells do (bash, Bourne, AT&T ksh, dash, yash...). In zsh, you'd use du -sch -- *(D) though, not du -sch -- * .*. – Stéphane Chazelas Jun 22 '15 at 20:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.