Find a file and operate it

find . -type f -name '*file*' -exec echo {} +

// In current folder and its descendant, find all files which contains 'file' in its name, and echo the file names.
find . -type f -name '*file*' -exec cat {} +

// In current folder and its descendant, find all files which contains 'file' in its name, and cat them one by one.

你可能感兴趣的:(Find a file and operate it)