I have many files I need to zip into a single directory. I don't want to zip all the files in the directory, but only ones matching a certain query.
I did
grep abc file-* > out.txt
to make a file with all the instances of "abc" in each file. I need the files themselves. How can I tell bash to zip only those files?
grep abc file-* > out.txt
to make a file with all the instances of "abc" in each file. I need the files themselves.zip ZipFile.zip file-*
, which is the obvious way to do it. You would need an intermediate file only if you were using a complexfind
or a concatenation of file lists from different searches.