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

learn more… | top users | synonyms

1
vote
1answer
39 views

linux unbuffered compression options

I'm working on a embedded system and due to persistent memory restrictions, I need to compress a log file "on the fly". My objective is to have a one liner inside a script, which would look like ...
5
votes
4answers
1k views

A gzip process regularly runs on my system, how do I figure out what is triggering it?

For a while now, I have had the problem that a gzip process randomly starts on my Kubuntu system, uses up quite a bit of resources and causes my notebook fan to go crazy. The process shows up as gzip ...
3
votes
2answers
98 views

Find common rows on two gzipped files

I've got two big gzip files. I need to find the common rows. Zgrep (gzip) does this to a large extent like zgrep -f <unzipped file> <zipped file> but I can't find any switches to do zgrep ...
0
votes
1answer
29 views

pv (progress bar) and gzip

Why is this not possible? pv ${dest_file} | gzip -1 pv is a progress bar error gzip: compressed data not written to a terminal. Use -f to force compression. For help, type: gzip -h 0 B 0:00:00 ...
1
vote
1answer
60 views

compression levels gz and xz

Why isn't there any difference (output filesize) with these command lines? Gzip stdin The output files have same filesize even though the compression levels are different tar ... | gzip -c -1 > ...
2
votes
0answers
61 views

How can I prevent gunzip | ntfsclone to hangup if the zip source is not readable

While trying to make an automatic OS installer (via livecd) I stumbled over a phenomenon that I'm not sure how I can correct it. I mount /mnt/source to a network drive where an iso file is located. ...
2
votes
2answers
121 views

gunzip from stdin

I have a large collection of gz files. I want to extract them all. Here is what I was trying to do: find . | grep .gz | gunzip However, gunzip does not accept list of files from stdinput. How can I ...
0
votes
1answer
29 views

Thunar custom action: Extraction to subdirectories

I am attempting to create a Custom Action in Thunar (File Manager) that will extract a gzip archive into a subdirectory of the same name (e.g. abc.tar.gz to abc/). I created this command, which works, ...
2
votes
0answers
64 views

How to convert existing gz (gzip) files to rsyncable

I am using rsync to back up a repository that contains many gz files including many new ones each day. The rsync backup proceeds more slowly than it should because these gz files are not built with ...
0
votes
1answer
37 views

filename.gz installation on AIX

I use sudo tar xvzf forwarder.tar -C /opt/ on Linux and this works perfectly then I proceed with a . /splunk start to install a forwarder file. While in AIX, its forwarder is in .gz format and ...
0
votes
1answer
29 views

Verify files AFTER extracting gzip

I gzip a folder, transfer it to a remote location and then extract it to a folder. The problem is that this machine is a little unreliable and sometimes writes don't succeed and there can be zero-byte ...
0
votes
1answer
50 views

Encrypting existing tar.gz archive

I know of a method to encrypt a tar.gz archive while creating it (not sure if it's a recommend one): tar -czvf /path/to/save/archive.tar.gz -C /path/to/archive . | openssl des3 -salt -k #PASSWORD# | ...
2
votes
3answers
103 views

How to search for text within compressed files and get just the files name

I'm trying to find just the files' names which contain an specific string. The files are compressed (.gz). I don't have zgrep installed and can't install it. Therefore I can't use the -l option. ...
5
votes
1answer
123 views

Get compressed size of piped output with gzip?

To get uncompressed size of already compressed file, I can use -l option in gzip utility: gzip -l compressedfile.gz However is there a way to get size of compressed file if I am piping the output? ...
0
votes
1answer
216 views

Append timestamp while zipping a file

find . -type f -name "querry_match" -size +550000000c -exec gzip {} \; I am using above command to find files greater than particular size and zip it. Can we modify above to include the time stamp at ...
0
votes
0answers
21 views

Extract tar archive ignoring the Archive file name in single command [duplicate]

I would like to extract a tar file archive.tar.gz into a directory /Users/guest/data without the creation of the archive directory in the data directory tar -xvf archive.tar.gz -C /Users/guest/data ...
0
votes
0answers
32 views

Why gzip doesn't decompress if set extension two times

If one creates two files, say, foo1.gz (.gz is just typed by myself) and foo2. Then compress them with gzip --force (to escape gzip: foo1.gz already has .gz suffix -- unchanged message). Now we have ...
0
votes
1answer
47 views

exclude files in tar.gz

I want to exclude two files from a tar file.. But it doesn't seem to work cd /var/www/public/api_test tar -zcvf api_v2.x.tar.gz api --exclude "./api/distributor_test.php" --exclude ...
0
votes
2answers
38 views

Wrong zip command messed up my project directory

I've issued a command gzip -r project.zip project/* in projects home directory and I've messed things up; every file in project directory and all other subdirectories have .gz extension. How do I undo ...
4
votes
3answers
146 views

How can I change the first line of a big gzip file without decompressing all of it?

I currently have a compressed file, A.gz which contains lots of tabulated data, including a header in the first line. I want to create another file, B.gz, which has the same data as the previous file, ...
0
votes
3answers
40 views

Backing up files [duplicate]

I would like to backup all files older than 90 days and greater plus gzip them. I could execute: find /path/to/files -type f -mtime 90 -exec gzip "{}" \; Problem with this command is it includes ...
1
vote
1answer
27 views

What happens to my files if I scp-ed to non existing directory

Here's what I did: copied some files from server to my local computer scp root@remotemachine:/var/log/nginx/* /home/me/logs deleted the files on the server The next moment I realized, that I ...
2
votes
3answers
169 views

How to print the before lines of search keyword with out using grep in a gz file?

How to print the lines before a search keyword without using grep in a .gz file? ID:342N000390AAAAAAAA 07/14/15 10:26 (MV90 ) * Register Data Imported * Warning - No ...
1
vote
4answers
237 views

UNIX to print a content from a .gz file

I have a .gz file with contents like the following: ID:123455 23-07-2015 mvni warning: RTM post warning : no profile data Using the string no profile data, I want to print the ID. I tried with ...
0
votes
4answers
103 views

How to delete files from a directory based on the contents of a gzipped tar file?

Given that I: have a directory that contains over 1000 files have a gzip'ed tar file that contains a subset of those files (x.tgz) What is the single command line (if it is possible) that will ...
8
votes
3answers
2k views

Pack file with tar.gz from root directory

I try to pack a .csv file with tar.gz, while being in the root directory. The file myfile.csv is located at /mnt/sdb1/ So the full filename is /mnt/sdb1/myfile.csv I try to save the tar.gz under ...
3
votes
4answers
1k views

Is it possible to make a .tar.gz file directly from stdin? Or, I need to tar together already gzipped files

I'm going to tell you exactly what I need in order to clarify the cryptic question in the title. I'm currently making scheduled MySQL backups of all my databases with something like: mysqldump ... | ...
6
votes
3answers
395 views

Does gz compression ratio improve over time?

I have some process that creates a stream of millions of highly similar lines. I'm piping this to gz. Does the compression ratio improve over time in such a setup? I.e. is the compression ratio better ...
0
votes
1answer
393 views

Compress multiple files and keep their name?

I have hundreds of .csv files that I need to compress into one file each. It should look like this originalname.csv.gz
0
votes
0answers
109 views

I can fix/repair small damaged tar.gz files using fixgz but it doesn't work on bigger files

The title tells it. I have some damaged .tar.gz files, most of them are pretty small (smaller than 1-2gb) but 4 of them are bigger and fixgz cant fix them, when i run fixgz for those big files, it ...
2
votes
1answer
81 views

Why the existence of gunzip?

What are the reasons (historical, compatibility issues ..) for the existence of gunzip despite gzip offers the same (and extended) functionality? I checked /bin/gzip and /bin/gunzip and they are ...
0
votes
1answer
158 views

Extract files from a corrupted .gz file

I tried to compress a directory using tar -zcvf output.gz input_dir. I suppose I should have used a .tgz extension for compressing. How do I untar output.gz? I tried both tar zxvf output.gz, which ...
1
vote
1answer
109 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 ...
11
votes
1answer
376 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
3k 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 ...
11
votes
3answers
5k 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
542 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
79 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
72 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
159 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
70 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
65 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
82 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 > ...
2
votes
1answer
260 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
691 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
499 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
172 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
389 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 ...
16
votes
2answers
2k 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
125 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 ...