Ever hard to find obscure places where disk space is wasted on your Mac? If you’re accustomed to the Linux terminal, you’ll try this:
$ du -h --max-depth=1 du: illegal option -- - usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k | -m | -g] [-x] [-I mask] [file ...]
… but that doesn’t work on Mac.
So here’s a Mac alternative:
$ find . -maxdepth 1 -type d -mindepth 1 -exec du -hs {} \;
I try that --max-depth
every. single. time.
Update: it’s even easier than that
Sure, the find
line works, but turns out I’ve been missing a much easier shortcut here.
$ du -hd1
Lesson learned: blog about it faster! ^^