I want a list of all the sub-directories and their total sizes. I can do it with the du -hs *
command in CentOS and Ubuntu, but why doesn't it work on Mac?
This is the output I get:
MyMac:~ user$ du -hs *
du: illegal option -- n
usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k | -m | -g] [-x] [-I mask] [file ...]
As far as I know, *
is a wildcard. Does macOS not support wildcards?
du
(Ubuntu), you may preferdu -hd1
which will include hidden ones, skip non-directory files, also give the disk usage for.
and work even if the list of files in the current directory is very large.