Gzip multiple


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Gzip multiple
# 15  
Old 05-27-2019
you know friend on the basis of these topics, I entered into reason to the person who asks me, and I will use .tar to achieve such a solution

Use tar I could get to what I need right ???

--- Post updated at 02:49 PM ---

they are as follows:

Code:
tar -cvf  filename_end.tar test1.csv test2.csv test3.csv test4.csv


thank you all for your support it served me very much hopefully not caused any problems
# 16  
Old 05-27-2019
Quote:
Originally Posted by tricampeon81
you know friend on the basis of these topics, I entered into reason to the person who asks me, and I will use .tar to achieve such a solution

Use tar I could get to what I need right ???
With over a 100 posts in this forum, you know that we can't answer that without knowing what operating system you're using and you clearly describing what you are trying to do. If your goal is to create a single file in the format produced by gzip, that contains more than one file and can be extracted into multiple files by a single gunzip invocation, then I don't think any currently existing software can do what you want.

If you're willing to accept an archive file containing your original files, cpio, pax, or tar can create such an archive for you and some versions of those utilities on many systems have options that will zip that archive into the same zipped file format that gzip creates. Otherwise, you can use gzip to zip the archive after it is created. On systems where cpio, pax, and tar have options to zip an archive, they also have an option to unzip an archive when reading it (or they can autodetect that an input archive has been zipped and can process it without needing an option).

On many systems, the tar command vgersh99 suggested will create an archive of your source files and then zip the archive for you.

Of course, if your system administrator had installed the manual pages on your system, you would be able to look at them and know what options are available on the utilities on your system. The manual pages available on this forum probably include a set of manual pages for a system similar to the one you have and they might give you the information you need. But each version of each operating system comes with its own set of manual pages and details on how some utilities behave often varies with each operating system update (so the man pages on unix.com are a good starting point but are not definitive for the operating system you are using).

Whether or not tar accepts:
Code:
tar -cvf filename_end.tar test1.csv test2.csv test3.csv test4.csv

or:
Code:
tar cvf filename_end.tar test1.csv test2.csv test3.csv test4.csv

or both is one of the things that varies widely between systems (and you still haven't told us what operating system you're using)!
This User Gave Thanks to Don Cragun For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Compress multiple gzip files

Good afternoon friends. I wanted to make a query, how to compress several files and leave them all in 1, for example flat text files: filename_1.csv filename_2.csv filename_3.csv expected result filename_end.gzip = (filename_1.csv filename_2.csv filename_3.csv) please (2 Replies)
Discussion started by: tricampeon81
2 Replies

2. Shell Programming and Scripting

Is better way copy list of multiple files, rename and gzip

Is better way to write the script loop through one by one "Old_File_1: & New_File_1:" to copy 100 files to /staging/test folder then re-name & gzip all those files? I wrote this code below and don't like that much. Thanks I have a control_file under /tmp/test folder like below 100 files and... (10 Replies)
Discussion started by: dotran
10 Replies

3. Shell Programming and Scripting

Gzip

if ;then echo "mrnet greater 5000" gzip /var/log/mrnet.log /var/log/mrnet.log.1.gz fi i'm looking if mrnet.log is bigger then 5000 then compress mrnet.log to mrnet.log.1.gz but it won't compress. (3 Replies)
Discussion started by: Froob
3 Replies

4. UNIX for Advanced & Expert Users

gzip vs pipe gzip: produce different file size

Hi All, I have a random test file: test.txt, size: 146 $ ll test.txt $ 146 test.txt Take 1: $ cat test.txt | gzip > test.txt.gz $ ll test.txt.gz $ 124 test.txt.gz Take 2: $ gzip test.txt $ ll test.txt.gz $ 133 test.txt.gz As you can see, gzipping a file and piping into gzip... (1 Reply)
Discussion started by: hanfresco
1 Replies

5. Shell Programming and Scripting

gzip

Hi, I want to gzip files in loop. for i in `ls *.xml`; do gzip $i; done But i am gettin error like "/usr/bin/ls: Arg list too long" Also please tell me how to do it with while loop and also using find and then exec. (7 Replies)
Discussion started by: tushar_tus
7 Replies

6. Shell Programming and Scripting

Gzip help

Hi Experts!! I was creating a zip file in a server which had zip installed in it. I have another server in which zip is not there and i am instructed to make use of gzip to compress files. I would need your help to know the way to create a gzip file. 1) I do the following to create the zip... (5 Replies)
Discussion started by: ganga.dharan
5 Replies

7. SCO

gzip

ciao a tutti, premesso che sono un principiante di unix, avrei bisogno di gzip/gunzip e SOPRATTUTTO delle istruzioni (ahimè dettagliatissime, come per un bimbo!) per installarlo... grazie mille, ciao (1 Reply)
Discussion started by: mfran2002
1 Replies

8. UNIX for Dummies Questions & Answers

GZIP help, please!

Gurus, My own stupidity (or ignorance...or both) put me in the situation I am in and I need help please: 1-My shell account (OS: HP UX v11) contains several work directories (/docs, /scripts...) 2-Our sysadmin has implemented aggressive disk quotas so I have to compress the files I put here... (2 Replies)
Discussion started by: alan
2 Replies

9. UNIX for Advanced & Expert Users

using gzip

Hi, I am trying to unzip a file that I unmounted onto a unix machine from a cd I had burned in a Windows machine. The file I am trying to unzip is a .tar file... it was originally a .tar.gz file because it was zipped using gzip. I have tried: % gzip -d hpux.tar (where hpux.tar is the file... (2 Replies)
Discussion started by: nattie_h
2 Replies

10. UNIX for Dummies Questions & Answers

gzip, multiple files

Hello Everyone, Here is what I am trying to do. I have four text files, I want to gzip them under unix and mail the zipped file via outlook. I am able to do this easily enough, but using winzip or pkunzip to unzip the file, there is only one file. (In essence, all four files were... (2 Replies)
Discussion started by: smbodnar
2 Replies
Login or Register to Ask a Question