A data compression program. Originally a GNU utility it has been cloned by most Unix variants.

learn more… | top users | synonyms

4
votes
0answers
49 views

How come zipping a created disk image, makes smaller files than piping?

Case 1. I use dd to create an image: dd if=/dev/rdiskx of=/path/to/image bs=1m. It's 16 GB in size. I zip it, and it's suddenly around 100 MB. Case 2. I use dd to create an image, piping it ...
0
votes
3answers
40 views

How do you view a sql.gz file as plain text SQL from the command line?

How do you view a sql.gz file as plain text SQL from the command line? I want to read the SQL statements stored in a .sql.gz file, from the command line on the server. I've tried tar -xzvf, but get ...
2
votes
3answers
102 views

How do I use gunzip and tar to extract my tar.gz file to the specific directory I want?

When I run gunzip -dc /path_to_tar.gz_file/zip1.tar.gz | tar xf - in the directory where the tar.gz file is located, it extracts just fine. How do I tell it to place the contents from the tar.gz file ...
3
votes
2answers
66 views

Gzip large amount of symlinked files

I have a folder containing a large amount of symlinked files. These files are each on the order of 10-11GB (fastq files to be specific). They come from a variety of source folders, but I made sure ...
0
votes
0answers
41 views

Unix gunzip decompression [closed]

So this is a very annoying problem, I have a file in the Linux terminal ERR091571_1.fastq.gz And I run gunzip on it to decompress the file... gunzip ERR091571_1.fastq.gz But all that happens is ...
15
votes
5answers
409 views

Is it possible to make zcat output text even if it's uncompressed? [duplicate]

The problem is I have some database dumps which are either compressed or in plain text. There is no difference in file extension etc. Using zcat on uncompressed files produces an error instead of the ...
0
votes
0answers
69 views

Extract specific folder from a tar.gz

I know this question was previously asked on this site before like here 1 and here 2 but no success for me. I want to extract the Measures folder from my S012011_csv.tar.gz zipped file. If I do tar ...
0
votes
1answer
73 views

touch & gzip all HTML, CSS, JS files in a directory recursively

I'm trying to optimize Nginx server. I've enabled Gzip_Static_Module to serve pre-compressed gzip static files like CSS, JS, HTML. Nginx Wiki says that the timestamps of the compressed and ...
0
votes
2answers
52 views

Unzipping appearing to fail

I run: ~$ gzip -d Mom.img.gz ^C ~$ I created Mom.img.gz by piping a dd to gzip. Should I be seeing output? I tried it with the GUI too, and the progress bar didn't move.
0
votes
2answers
119 views

OpenMeetings latest release not unzipping

I am trying to install OpenMeetings for centos 6.5 32 bit but everytime I try to untar or unzip the latest binary release I get the following error: tar -xzvf apache-openmeetings-3.0.0.tar.gz gzip: ...
3
votes
2answers
66 views

TAR: better to skip directory or use split

I've got a file.tar.gz that I create and backup to Amazon S3. It's gotten bigger than Amazon's limits and thus has not been backing up. This is my current command: tar -cpzf file.tar.gz directory/ ...
2
votes
2answers
107 views

How can I flatten nested .tar.gz files?

I've got a bunch of .tar.gz files in different paths. I'd like to create a new .tar.gz file at some common ancestor of them and I don't want it to be composed of nested .tar.gz files. How can I easily ...
1
vote
2answers
114 views

Uncompress files when rsync'in

I have 22,000 gzip files on a remote server, which I would like to trasnfer to my machine. I would also like to uncompress these files before/while transferring. Is it possible? My rsync command ...
1
vote
2answers
74 views

portable command to unzip and untar on non GNU and old unix

On AIX 6.1 without GNU Tool installed I have a .tar.gz file. On Ubuntu I would use the very useful command : tar xzf myfile.tar.gz but in this case the z switch is not possible. I do remeber a ...
65
votes
4answers
6k views

Why are tar archive formats switching to xz compression to replace bzip2 and what about gzip?

More and more tar archives use the xz format based on LZMA2 for compression instead of the traditional bzip2(bz2) compression. In fact kernel.org made a late "Good-bye bzip2" announcement, 27th Dec. ...
1
vote
1answer
408 views

Error with a .gz file decompression in Mint, but works perfectly in Windows, so the file is not corrupt

I've downloaded some .csv files from the OECD Stats website, since I need them to plot some graphs with gnuplot. When I open them with File Roller 3.4.1 (the default program to handle archive files), ...
10
votes
2answers
30k views

Can I zip an entire folder using gzip?

I'm trying to zip a folder in unix. Can that be done using the gzip command?
4
votes
3answers
2k views

speed up gzip compression

Is it possible to speed up the gzip process? I'm using mysqldump "$database_name" | gzip > $BACKUP_DIR/$database_name.sql.gz to backup a database into a directory, $BACKUP_DIR. the manpage ...
3
votes
1answer
320 views

Speed up zgrep on a multi-core computer

I'm running zgrep on a computer with 16 CPUs, but it only takes one CPU to run the task. Can I speed it up, perhaps utilize all 16 cores? P.S The IO is just fine, I could just copy the gzipped file ...
0
votes
2answers
288 views

Is it safe to assume the tar.gz file is healthy?

I have a rather large tar.gz file (17GB) which is a tar.gz version of a directory. The problem here is I got the following message after the tar operation. tar: Error exit delayed from previous ...
2
votes
3answers
308 views

zcat a file line by line? [closed]

I have written a C++ application that reads files line by line. It reads one line, does processing, then reads the next line. I would like to add support for gzipped files, and am looking to an ...
6
votes
3answers
3k views

Efficiently remove file(s) from large .tgz

Assume i have an gzip compressed tar-ball compressedArchive.tgz (+100 files, totaling +5gb). What would be the fastest way to remove all entries matching a given filename pattern for example ...
4
votes
2answers
250 views

Extract timestamp from a gzip file

How can I know the raw original timestamp of a file foo compressed with gzip without having to decompress foo.gz? gzip --verbose --list foo.gz and file foo.gz will print formatted date and time.
16
votes
5answers
1k views

Is there a tool that combines zcat and cat transparently?

When handling log files, some end up as gzipped files thanks to logrotate and others not. So when you try something like this: $ zcat * you end up with a command line like zcat xyz.log xyz.log.1 ...
1
vote
1answer
2k views

gunzip multiple compressed files to another directory without deleting the .gz files

I have multiple .gz file in a folder and I want to unzip it in other folder through gunzip without deleting parent file. Please help.
1
vote
2answers
336 views

Chaining mysqldumps commands to output a single gzipped file

Let's say I have these series of commands mysqldump --opt --databases $dbname1 --host=$dbhost1 --user=$dbuser1 --password=$dbpass1 mysqldump --opt --databases $dbname2 --host=$dbhost1 --user=$dbuser1 ...
7
votes
1answer
854 views

Under what circumstances does gunzip & tar xf work but tar xzf fail?

To illustrate the point: I have downloaded the LEDA library from the company's website. Using tar -xzf on it fails: $ tar -xzf LEDA-6.3-free-fedora-core-8-64-g++-4.1.2-mt.tar.gz tar: This does not ...
3
votes
8answers
2k views

Triple compression and I only save 1% in space?

I've been trying to save space on my linux server, and I had a folder containting, in subfolders, 22GB of images. So I decided to compress them. First I used tar: tar -zcf folder.tar folder Then ...
5
votes
4answers
800 views

How to create a gzip file without .gz file extension?

I would like to create a gzipped file that retains the original file name. For example gzipping "example.txt" should output a gzipped file named "example.txt" rather than "example.txt.gz." Is it ...
0
votes
1answer
1k views

How to disable gzip compression with wget?

There are other questions asking how to enable gzip compression with wget, and lots of web pages out there telling how to do this, but I need the opposite. I'm trying to locally mirror a site, and ...
3
votes
2answers
465 views

How to bzip a file with minimum cpu percentage?

I am using bzip2 to compress a file,the process takes more that 100% cpu.Is there any way to run bzip2 with minimum CPU precentage.
1
vote
1answer
166 views

Blocking gzip HTTP content with Iptables or Snort?

I'm looking to drop a connection if a website contains a certain word or phrase. The issue is, the site is typically compressed with gzip. Any ideas?
0
votes
1answer
119 views

How to safely enlarge a gzipped file?

I have a gzipped file (around 3Kb), and I want its size to be exactly 4000. To achieve this goal, is it safe to add trailing padding with zeroes? (By safe I mean that the content of the gzipped file ...
4
votes
3answers
1k views

How can I check if two gzipped files are equal?

I am trying to save space while doing a "dumb" backup by simply dumping data into a text file. My backup script is executed daily and looks like this: Create a directory named after the backup date. ...
0
votes
2answers
180 views

How to uncompress a gzip file with a custom extension?

I have a file called file1.atz. I know that it is gzipped. The uncompressed file extension should be .ats. I have read the man pages and I just want to verify I'm uncompressing this correctly, because ...
12
votes
5answers
14k views

tar: Removing leading `/' from member names

root@server # tar fcz bkup.tar.gz /home/foo/ tar: Removing leading `/' from member names How can I solve this problem and keep the / on file names ?
2
votes
2answers
6k views

Compress old log file into single zip-linux

I have a folder /home/testuser/log which contain log files of one day old *.log. I wish to compress all the log files older than one day to a single zip(gzip or tar.gz) and delete the older files. I ...
1
vote
1answer
250 views

mirror a site with wget that only response with gzip

I'm trying to mirror a site but the server only responses with gzip pages so wget won't recurse. I've searched around and there are some references to a patch to add gzip support to wget however they ...
3
votes
1answer
4k views

gunzip all .gz files in directory

I have a directory with plenty of .txt.gz files (where the names do not follow a specific pattern.) What is the simplest way to gunzip them? I want to preserve their original names, so that they go ...
1
vote
2answers
4k views

tar: Unexpected EOF in archive

I am trying extract .tar.gz file it but with no luck gzip: stdin: unexpected end of file tar: Unexpected EOF in archive tar: Unexpected EOF in archive tar: Error is not recoverable: exiting now the ...
0
votes
1answer
2k views

bash script to gzip files

I have to make a bash script that do a gzip of a file if is older than 60 days, and move it in a subdir which name is the beginning of the filename. Here an example of the files I have to work with: ...
3
votes
1answer
409 views

tar: exclude gzip file, and don't try to gunzip it

I would like to skip a large gzip file when I extract a tar file, but everytime tar starts to gunzip it to look inside it seems. Even when I just try to peek inside tar seems to start gunzipping it, ...
2
votes
1answer
481 views

Subprocess.call() and gunzip error

I'm trying to use Python's package subprocess to gunzip and gzip files. I'm using the following command: subprocess.call(['gunzip', a_path+myfile_gz], shell=True) Then I get the error message: ...
34
votes
3answers
22k views

How to tell gzip to keep original file?

I would like to compress a text file using gzip command line tool while keeping the original file. By default running the following command gzip file.txt results in modifying this file and renaming ...
3
votes
1answer
2k views

Gunzip multiple files and rename them

I want to know whether it is possible to gunzip multiple files and rename them with one command/script. I have a bunch of files in the format: test.20120708191601.DAT.3599502593.gz ...
3
votes
2answers
663 views

Search for files with a specific size inside recursive zipped archives

I have a folder with several files. These files are either .xml or .zip files. These .zip files contain .xml and/or .zip files. These .zip contains also .xml or .zip, and so on... until we finally ...
7
votes
2answers
9k views

Is it possible to compress a very large file (~30 GB) using gzip?

Is it possible to compress a very large file (~30 GB) using gzip? If so, what commands, switches, and options should I use? Or is there another program (preferably one commonly available on Ubuntu ...
5
votes
5answers
2k views

Unix bash script check empty gz files

I'm trying to write a bash script that will go into a directory loop through the .gz files and delete them if they are empty (ie the uncompressed file contained within in empty. I've got a couple of ...
-5
votes
2answers
3k views

ungzip the gizpped war

I am totally new to linux. I have gzipped a war file like this gzip mytest.war. I try to ungzip it like it --ungzip mytest.war.gz, it said command can't be found. How can I ungzip it? Moreover, how ...
16
votes
1answer
17k views

How do you extract a single folder from a large tar.gz archive?

I am using this command on a 5GB archive tar -zxvf archive.tar.gz /folder/in/archive is this the correct way to do this? It seems to be taking forever with no command line output...