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

learn more… | top users | synonyms

4
votes
3answers
338 views

Create an archive with command “gzip”

I have to create an archive with the command gzip (not tar - it's necessary) and the archive should contain files from another directory - for example, /etc. I tried to use command gzip myetc.gz /etc ...
1
vote
1answer
22 views

Compressing a folder but do not compress specific file types but include them in the gz file

I am using tar with pigz to compress a folder and save a backup. Size of this folder ~250 GB or more. This folder has variety of content including numerous text and log files, ISOs and zip files in ...
0
votes
0answers
15 views

zopfli --i1000 all css, js files in a directory and sub directorys

My servers OS is CentOS, with Nginx. I've enabled Gzip_Static_Module for nginx. Now after update of a website I need to gzip all the js, css files. Is there a way to search a dir like ...
5
votes
3answers
359 views

How to recursively uncompress gz files on a remote host with limited commands?

I have a bunch of .jpg.gz files in a directory that I need to decompress. I know that the decompress command is: tar -xzvf FileNameHere.jpg.gz But is there a flag that you can recursively ...
1
vote
2answers
31 views

gunzip multiple files

I have a directory where there are multiple folders, each of folder contains a .gz file. How can I unzip all of them at once? My data looks like this List of folders A B C D In every of them ...
3
votes
1answer
34 views

Corrupted gz file

I have a MySQL database backup in a gz file. When trying to uncompress it I get the following: gzip: db_stepup.sql.gz: not in gzip format I read that sometimes is just a matter of removing the gz ...
0
votes
1answer
36 views

unzip without replacing original file and report to log

I want to write a bash script to decompress a file without overwriting the original one and redirect the operation result into a log file. I found an answer to the first part of my question at: How ...
2
votes
1answer
42 views

How do I search find files and compress if greater than 500M

I need to find files greater than 500M and older than 1 day and I need to compress those files. Also I need to omit files with .gz extension. How can it be achieved?
0
votes
1answer
38 views

gzip - is there a risk to lose files during compression if process dead?

Is there a risk of losing files during compression if process dies? I'm gzipping big files using wildcard, but accidentally running it without screen or nohup. Is there a risk to lose source files if ...
0
votes
1answer
51 views

Linux Gzip increasing size

I try to gzip a file abc.log which has size of 111 bytes, but after gzip, the size of the file increased to 125 bytes, why is that? Is it when i perform gzip, it will create header and trailer that ...
0
votes
3answers
80 views

dd show 'raw' progress while piping output

I am attempting to perform a specific dd operation and appending 'raw' data of the transfer to a log file which will be polled by something else, to provide a live view of the transfer on another ...
1
vote
2answers
763 views

How to append a line in a zipped file without unzipping?

mknod /tmp/oracle.pipe p sqlplus / as sysdba << _EOF set escape on host nohup gzip -c < /tmp/oracle.pipe > /tmp/out1.gz \& spool /tmp/oracle.pipe select * from employee; spool off ...
1
vote
1answer
66 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
105 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 ...
1
vote
1answer
284 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
86 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
140 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
248 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
54 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, ...
3
votes
0answers
176 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
45 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
33 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
86 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
161 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
228 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
488 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
1answer
61 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
45 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
286 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
41 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
193 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
342 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
301 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
2k 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
399 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
710 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
150 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
92 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
317 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
157 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
391 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
5k 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
8k 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
850 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
100 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
81 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 ...