Strangely this command works perfectly on 2 SLES11 servers, but not another. Here is my command ...
du `find -maxdepth 7 -type d -name of\*` -hs
and I get a result like ...
du: invalid option -- 'I'
du: invalid option -- 'n'
du: invalid option -- 't'
du: invalid option -- 'e'
du: invalid option -- 'r'
du: invalid option -- 'v'
du: invalid option -- 'i'
du: invalid option -- 'e'
du: invalid option -- 'w'
du: invalid option -- '/'
du: invalid option -- 'o'
du: invalid option -- 'f'
du: invalid option -- 'd'
du: invalid option -- 'j'
du: invalid option -- 'r'
du: invalid option -- 'I'
du: invalid option -- 'n'
And this is the result from an identically built server ...
du `find -maxdepth 7 -type d -name of\*` -hs
200K ./xxxxxxxxx/xxxxxxx/xxxxxxx/of19darc
6.4G ./xxxxxxxxx/xxxxxxx/xxxxxxx/ofkuoarc
188K ./xxxxxxxxx/xxxxxxx/xxxxxxx/ofkuoarc/ofkuoarc
180K ./xxxxxxxxx/xxxxxxx/xxxxxxx//data/Archive/ofw68arc
du: cannot access `yyy/Cyyyyy/GW': No such file or directory
du: cannot access `Archive/of19darc': No such file or directory
etc
Will fail on any files that contain whitespace and will attempt to treat files starting with
-
(or having-
after whitespace) as options todu
.Try something like
or if your
find
supports it (the faster)