Skip to content

{ Category Archives } unix

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

my favorite tar command

This archives and compresses a bunch of files in one step.

tar czvf archiveName.tgz directoryToArchive

Note that the ‘f’ option must come last.