nv6kra
Last Updated: February 25, 2016
·
305
· lotia
B9d7297223985ffafd0b1981b6cdcb28

display size of found files

find . -type f -name "*.bz2" | xargs du -h

The above snippet finds all files ending with the *.bz2 suffix and pipes the results to xargs which executes du -h on the passed arguments providing results in human readable form.

Piping to xargs provide a more portable alternative to using -exec since BSD find and GNU find behave differently.

Say Thanks
Respond