I want to estimate the amount of disk space used by a user via Apple Remote Desktop Unix command.

I've been trying the following command, running as root

sudo du -sh /users/

but I'd like to add the exclusion to ignore the size of the /users/admin directory.

The du manual shows -I[mask] as the way to do this, but I can't get it to work. Any help please?

du -sh -Iadmin /Users

will ignore any subdirectory "admin", e.g. /Users/admin - on a Mac. Please check if your target system supports the -I option (man du).

You might probably have to use --exclude=admin instead, if the target system has a GNU coreutils du.

  • Perfect thanks - I was trying many variations of -I=admin but as you say, I didn't need the '=' :) – MagsM Jun 16 '17 at 17:47

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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