my favorite grep to mv pipe
grep –max-count=1 -l -r –include=*.txt –exclude-dir=fragments ‘pattern’ ./*|while read line; do mv “$line” newLocation; done
grep –max-count=1 -l -r –include=*.txt –exclude-dir=fragments ‘pattern’ ./*|while read line; do mv “$line” newLocation; done
This archives and compresses a bunch of files in one step.
tar czvf archiveName.tgz directoryToArchive
Note that the ‘f’ option must come last.