Sky020
1
Hello all,
I am trying to print the sizes of all directories with the name target
. I assumed I could do this:
find -maxdepth 3 -name target -type d | du -sh
However, this causes du
to start listing the sizes of all directories. Am I incorrectly piping this?
Sky020
2
I am still not sure why it does not work to pipe to du
, but what works is to use -exec
:
find -maxdepth 3 -name target -type d -exec du -sh '{}' \;
system
Closed
3
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.