I've successfully used the following command on Linux to remove empty
directories in a structure, but it's not working on the Mac (substituting
/path/path for the proper location of course):

find /path/path -type d -print0 | xargs -0 rmdir --ignore-fail-on-non-empty

When I run this on the Mac I get:

rmdir: Illegal option -- -
usage: redir [-p] directory

This doesn't change if I substitute -p for --parents (which seems to be the same

Any idea how to do this better?

My actual application is that I am routinely moving directories from the Mac to
another location with rsync over ssh, including the --remove-source-files switch
- so I end up with empty directories that I then need to find a way to get rid

Maybe there is a more elegant way on the Mac to do this?


Novell Knowledge Partner
Moving GroupWise to Linux?