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

learn more… | top users | synonyms

1
vote
1answer
22 views

gzip files with cat and from pipe gives different results

Why does this give such output (both commands are supposed to do the same thing) and how can one make them give identical output? diff <(cat some_file | gzip -c - | base64) <(gzip -c some_file ...
10
votes
1answer
278 views

Why does gzipping a file on stdin yield a smaller output than the same file given as an argument?

When I do: # gzip -c foo > foo1.gz # gzip < foo > foo2.gz Why does foo2.gz end up being smaller in size than foo1.gz?
0
votes
2answers
31 views

tgz file give invalid compressed data--format violated [closed]

I have download this file http://download.icu-project.org/files/icu4c/55.1/icu4c-55_1-HPUX11iv3-aCC.tgz https://ssl.icu-project.org/files/icu4c/55.1/icu4c-bin-55_1.md5 md5sum ok But on linux and ...
8
votes
3answers
526 views

How do I compress files in-place?

I have a machine with 90% hard-disk usage. I want to compress its 500+ log files into a smaller new file. However, the hard disk is too small to keep both the original files and the compressed ones. ...
1
vote
1answer
57 views

unpigz (and untar) to a specific directory

I know how to gunzip a file to a selected location. But when it comes to utilizing all CPU power, many consider pigz instead of gzip. So, the question is how do I unpigz (and untar) a *.tar.gz file ...
3
votes
1answer
47 views

use tar to extract and immediately compress files from tarball

I have a compressed tarball (eg foo.tar.gz) that I wish to extract all the files from, but the files within the tarball are not compressed. That is to say, the contents of foo.tar.gz are ...
0
votes
1answer
30 views

How do you combine -r and -c for gunzip?

I am trying to recursively gunzip files (-r) but don't have permission in their original location to store them. I know to change the location for a single file you do gunzip {file} -c > {new file ...
0
votes
2answers
38 views

Is it possible to list all files in a *.tar.gz file without scanning it's whole contents?

I know this way only: tar --full-time -tvf /path/to/file.tar.gz But it makes tar to scan all the archive and it is time consuming if it is a very big one. My question is maybe there is a way to ...
-1
votes
1answer
47 views

Erratic behavior with gzip on unix

I am compressing log files daily and very recently I have been seeing some crazy results on the file type of the file after compression. Normally you would expect file filename.gz returning gzip ...
4
votes
1answer
45 views

Recovering data written to file that moved

I have a Python daemon running on CentOS that opens a file at the beginning of a session, and keeps writing to it. A cronjob however, gzipped the file that was being written to, and so the file moved ...
1
vote
1answer
58 views

Bash: using both way redirections in a shell script

I'm writing a shell script to compress and backup certain files. This will compress and move large files with sizes up to 4 GB. I'm having trouble with this line: gzip < $filelocation > ...
1
vote
1answer
51 views

Combining, sorting and deleting duplicates in numerous gzip files

I am going to be combining 15 different gzip files. Ranging in size from 2 gigs to 15 gigs each so the files are relatively large. I have done research on the best way to do it but still have some ...
0
votes
1answer
41 views

What's the difference between gzip and compress?

What is the difference between gzip and compress? What are the advantages of using compress function. I could see a size difference in the compressed file, but apart from this what are the main ...
0
votes
1answer
106 views

zcat / gzip error while piping out

I am using zcat to output the contents of a rather large .gz compressed text file. I am piping the output to grep and searching for a specific string. Below is the command I am running. ...
1
vote
1answer
46 views

How to replace string of the file, which is present in tar file through UNIX

I have a tar archive xyz.tar containing lots of .sh files like: 123.sh 456.sh 789.sh Every .sh file has some string content, e.g. 123.sh contains welcome to Hollywood, 456.sh contains I love ...
0
votes
2answers
125 views

Gzip file but excluding some directories|files and also append current date

I'm looking for a way to create a .tar.gz file from a directory but I have some doubts. I'm know that the command for create the file is: tar -zcvf /path/to/compressed/file.tar.gz /path/to/compress ...
12
votes
2answers
562 views

Fastest way of working out uncompressed size of large GZIPPED file

Once a file is gzipped, is there a way of quickly querying it to say what the uncompressed file size is (without decompressing it), especially in cases where the uncompressed file is > 4GB in size. ...
1
vote
1answer
26 views

Is there a difference between gunzip -c and gunzip in terms of system utilization?

Is there a difference between zcat/gunzip -c and gunzip apart from the obvious one that one outputs it to the terminal and the other decompresses it to a file? I'm looking from a CPU utilization ...
1
vote
3answers
131 views

Gunzip in range of files

I'm running a long copy of .gz files from one server to another. At the same time, I'd like to unzip the files already copied. For example, al filenames that start with a through filenames starting ...
2
votes
2answers
83 views

How to gunzip files present in multiple subdirectories in subdirectories

I am learning Linux and I was trying the gzip command. I tried it on a folder which has a hierarchy like Personal/Folder1/file1.amr Personal/Folder2/file2.amr Personal/Folder3/file3.amr ...
-1
votes
2answers
77 views

Gzip Mutliple files using single command [closed]

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
111 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
58 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
249 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
474 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
2k 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
177 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): ...
3
votes
1answer
199 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 > ...
10
votes
1answer
1k 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, ...
6
votes
5answers
941 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
322 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
473 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
71 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
182 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 ...
2
votes
2answers
1k views

Unzipping a .gz file without removing the gzipped file

I have a file 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 ...
2
votes
2answers
273 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
502 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
1k 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
156 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
900 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
87 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
428 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
3k 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
821 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
155 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
1k 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
182 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
227 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
106 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
192 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: ...