1
I have directory containing big list of files. I'd like to gzip each file of a certain mask to a separate archive. How do i do that automatically?
For example here's sample directory contents: - index.html - start.html - myfile1.txt - myfile2.txt - myfile3.txt
How to i create separate archive (myfile1.tar.gz,myfile2.tar.gz ...) for each file starting with 'myfile*' ?
Thank you very much, it works ! I was looking for this solution exactly. – user1184899 – 2012-02-16T15:19:49.133
This breaks on files with spaces in their name. And why not use
for file in abc_*instead offor file in $(ls abc_*)? – slhck – 2012-05-30T06:21:25.873