If you're really just looking to echo
the results of find
, you can use the parameter -print
(or just no additional parameter at all) to have find
print a list of its results.
If you want to delete the results, there's -delete
(which can be combined with -print
to get a list of the deleted files).
If you want to do something else with/to the results, you can use the parameter -exec
to pass the results as parameters to another command, e.g.
find . -type d -exec tar cf {}.tar {} \;
to compress all directories into individual tarballs (one tar per directory, since \;
makes find
run the -exec
command with one result at a time)
find . -type d -exec tar cf all-directories.tar {} +
to compress all directories into a single tarball (+
makes find
run the -exec
command with as many results as possible at a time)