I have 100 files: cvd1.txt cvd2.txt ... cvd100.txt
How to gzip 100 files into one .gz file so that after I gunzip it, I should have cvd1.txt, cvd2.txt ... cvd100.txt separately?
Thanks for your help
migrated from stackoverflow.com Sep 12 '11 at 22:05This question came from our site for professional and enthusiast programmers. |
|||
|
|
|||
|
if you have zip,
Don't need to |
|||||||||
|
|
You want to
To untar the gzip'd tar file you would do:
This would extract your files under the |
|||||||||
|
|
You'll want to use tar, like so:
tar puts the files together, while gzip then performs the compression. Quoth the gzip manpage:
|
||||
|
|
|
gzip by itself does not know anything about file structure. To do what you want, you need to first put the files into some kind of container file (e.g. a tar structure, or similar) and then gzip that. tar has z and j (for bzip2) switches on GNU platforms to do this. |
|||||||||
|
|
To compress multiple files with different patterns, we could this :
this will add all .yml files that starts with Alice from any sub-directory and add all .json files that starts with Bob from any sub-directory. |
|||
|
|
|
You can do it by:
to unzip it:
or
to unzip it:
or
to unzip it:
|
||||
|
|