7

What is the macOS (10.14.6) equivalent of --exclude in du ?

du -hs --exclude=./node_modules/
du: illegal option -- -
usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k | -m | -g] [-x] [-I mask] [file ...]
1
  • 2
    "-I mask Ignore files and directories matching the specified mask." If you need GNU behaviour, install coreutils via brew and invoke gdu (like gfind or ggrep)
    – anki
    Commented Aug 15, 2020 at 7:57

1 Answer 1

10

I had luck on MacOS 10.15 with the following:

du -I System -I private -I Library

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .