How do you grep and move files?

Phương Linh

New member
How do you grep and move files?
Answer
“grep -l” can be used to get the list of files. Then you can
use “xargs” to move the files, like this: find . -type f | xargs -r grep -l “phrase” | xargs -r mv -t target-directory.
 

Tìm kiếm

Back
Top