using tar to compress specific files in a directory named a certain way
I need to create a tar archive of only files that start with "60-", located in a directory with a lot of other files that I don't want in the archive.
I tried this but it doesn't work:
tar -zcvf backfill.tar.gz | grep "60-"
Can someone help?
Thanks. When I ran the command the way you suggested,I received the "argument list too long" message so I created a text file containing the list of files:
find /usr/www/htdocs/images/closeup | grep "60-" > filelist.txt
And then, fed the text file to tar:
tar -zcvf backfill.tar.gz --files-from filelist.txt
i think this works too
tar -zcvf backfill.tar.gz `ls 60\-*`
|All times are GMT -5. The time now is 12:22 AM.|