Monday, August 24, 2009

How to compress multiple files using tar and gzip

1. Put all the required filenames in a file
2. tar all the files
3. gzip the tar file
eg:
vjsujay@gmail.com$ ls *.html > filelist
vjsujay@gmail.com$ fname=filelist
vjsujay@gmail.com$ tar -cvf multihtml.tar -L $fname
vjsujay@gmail.com$ gzip multihtml.tar
Final file will be multihtml.tar.gz

No comments: