# generate the file list find -iname '*.ext' > fileList.txt #run tar passing it the file list tar czvf archive.tar.gz --files-from fileList.txt # a shorthand of this would be: find . -name '*.ext' -print | tar -cvzf archive.tar.gz --files-from -
So the original poster's method is correct.
But anyway, I hate tar files that unarchive into the current directory. I think it's always better to place all the files into their own directory and archive that (which eliminates the need for this piece of shell code in the first place).
You need to create an account or log in to post comments to this site.