I am doing a find and then getting a list of files. How do I pipe it to another utility like cat (so that cat displays the contents of all those fi
In bash, the following would be appropriate:
find /dir -type f -print0 | xargs -0i cat {} | grep whatever
This will find all files in the /dir directory, and safely pipe the filenames into xargs, which will safely drive grep.
Skipping xargs is not a good idea if you have many thousands of files in /dir; cat will break due to excessive argument list length. xargs will sort that all out for you.
The -print0 argument to find meshes with the -0 argument to xargs to handle filenames with spaces properly. The -i argument to xargs allows you to insert the filename where required in the cat command line. The brackets are replaced by the filename piped into the cat command from find.