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

learn more… | top users | synonyms

0
votes
1answer
43 views

tar & gzip the same folder but get different size [on hold]

There are two identical folders on two external hard disks. Two hard disks are brand new with the same format I tried du -s to check the size of both folders. The sizes are the same. The archives ...
-1
votes
2answers
33 views

Gzip Mutliple files using single command [on hold]

Want to Gzip my all the .csv files into a gzip file. I am using this command. gzip *.csv; Problem File contains '//' in its name that's why command is giving error. Error : - '//File.csv' is not ...
0
votes
0answers
29 views

how to write dd command to replace backup image of root partition?

I have installed rhel6.5 in my pc. After that I have changed some configurations in file system. now I have taken backup image of /dev/sda1 which is a root partition of 15gb in size using the command ...
2
votes
1answer
37 views

Payload size of a gzip archive

Is there any way to check the normal size of the compressed datasets (.gz) without decompressing it? For example, I have 50 large .gz files (in total 50 Gb) that can't be decompressed due to storage ...
3
votes
2answers
68 views

Less resource hungry alternative for piping `cat` into gzip for huge files

I have some files of which some are very large (like several GB), which I need to concatenate to one big file and then zip it, so something like this: cat file1 file2 file3 file4 | gzip > ...
3
votes
1answer
82 views

Estimate the size of the extracted files before extraction a `tar.gz` archive?

Before using tar to extract a .tar.gz archive, it is possible to get an estimate of how large the extracted files are in total?
1
vote
1answer
92 views

Why I get unexpected end of file in my script when using gzip?

I have one doubt with this: for i in ./*.gz do gunzip -c $i | head -8000 | gzip > $(basename $i) done I get an "unexpected end of file" error for gzip, and I don't get the 8000 at all, only a ...
1
vote
2answers
119 views

command to get topmost directory name in compressed files

Filenames are ones shown below, but the directory will be libgit2-0.21-1 when tar xvf v0.21.1.tar.gz, so how use one-liner to get the directory name(report error if more than two directory exist): ...
2
votes
1answer
78 views

How to create a deterministic tar.gz using git-archive?

Creating a git repository for testing. ~ $ mkdir somefolder ~ $ cd somefolder/ ~/somefolder $ git init Initialized empty Git repository in /home/user/somefolder/.git/ ~/somefolder $ echo test > ...
9
votes
1answer
448 views

Use gzip to compress a directory except for already existing .gz files in the directory

I have a directory of logs that I would like to set up a job to compress using gzip. The issue is I don't want to recompress the logs I've already compressed. I tried using ls | grep -v gz | gzip, ...
3
votes
4answers
354 views

Does gzip add integrity/crc check to a .tar?

I run commands: tar -cf myArchive.tar myDirectory/ gzip myArchive.tar then I copy the file over a lot of unreliable mediums, and later I unpack it using: tar -xzf myArchive.tar.gz The fact that ...
0
votes
1answer
81 views

moving files to a folder and zip the folder

I have to zip a few files induvidually from folder A and move them to folder B on the same directory which takes lot of time. So I thought of moving all those files to be zipped to a new folder(c), ...
0
votes
2answers
105 views

How to combine gunzipped fastq files?

How can I combine gzipped fastq files? I tried this for read 1 and read 2 zcat file_1.fastq.gz file_2.fastq.gz | gzip > combined.fastq.gz but it is giving me unequal number of reads. Why? Is ...
0
votes
2answers
48 views

Automatic extraction of zip files like in osx

In Mac OSX if you have downloaded a zip/gz/bz2 file, and you double click it in Finder, then the archive is automatically extracted for you in a subfolder, which I find very nice. I am wondering if ...
1
vote
2answers
162 views

I accidentally GZIPed a whole bunch of files, one by one, instead of using tar(1). How can I undo this mess?

I'm new to the gzip command, so I googled some commands to run so I can gzip an entire directory recursively. Now while it did that, it converted each of my files to the gzip format and added .gz to ...
1
vote
2answers
84 views

Unzipping a .gz file without removing the gzipped file

I have file.gz, when I try to unzip this file by using gunzip file.gz, it unzipped the file but only contains extracted and removes the file.gz file. How can I unzip by keeping both unzipped file and ...
2
votes
2answers
98 views

Estimate compressibility of file

Is there a quick and dirty way of estimating gzip-compressibility of a file without having to fully compress it with gzip? I could, in bash, do bc <<<"scale=2;$(gzip -c file | wc -c)/$(wc ...
4
votes
2answers
227 views

can't decompress .tgz using gunzip

I was able to archive and compress a folder with the following command: tar -cvfz example2.tgz example1 I then removed the example1 folder and tried to unpack the archive using this command: tar ...
0
votes
0answers
881 views

cuda - gzip: stdin: invalid compressed data--format violated

I downloaded cuda toolkit from here! I'm running on 32-bit Linux(Mint 17). I had to download .run file(the downloaded file name is ...
0
votes
0answers
76 views

Terminal freezes after using tar or gz

On Linux within bash the Pseudo Terminal window (terminator) as well as the Terminal itself "freezes" when trying to use autocomplete (TAB) as well as after getting an error message using gzip and ...
3
votes
4answers
299 views

gunzip a folder with many files

I have a folder with 36,348 files gz files. I want to unzip all of them. Running: gunzip ./* results in -bash: /usr/bin/gunzip: Argument list too long Whats the easiest way to get around ...
4
votes
1answer
84 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
134 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
906 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
382 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
82 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
776 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
135 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
2answers
161 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
71 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
155 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
110 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
181 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
289 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
302 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 ...
72
votes
4answers
10k 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
1k 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), ...
33
votes
2answers
111k 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?
5
votes
3answers
4k 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
540 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
417 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
444 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
5k 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
372 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.
18
votes
6answers
2k 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
3k 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
432 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
1k 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 ...
6
votes
5answers
1k 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 ...