4

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 ...]
anjanesh
  • 407
  • 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 Aug 15 '20 at 07:57

1 Answers1

7

I had luck on MacOS 10.15 with the following:

du -I System -I private -I Library
JS.
  • 186