using tar to compress specific files in a directory named a certain way
Hi All,
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 |
Quote:
Code:
tar -zcvf backfill.tar.gz 60-* John G |
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 Worked fine. Thanks |
i think this works too
tar -zcvf backfill.tar.gz `ls 60\-*` |
All times are GMT -5. The time now is 09:53 AM. |