Copy All Files with Specific String to Another Directory in Terminal on Mac - VicPhanDevOps/mac GitHub Wiki
• Type find . -type f -exec grep -lr ‘< string >’ {} \; -exec cp -r {] < destination directory > \;
and press the return key to find specific string in all files in the source directory and copy them to the destination directory.
•
• Type ls < destination directory >
and press the return key to sanity check that the files successfully copied over there.
•