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

learn more… | top users | synonyms

-1
votes
0answers
19 views

Sporadic error decompressing tar/gzip

I have a nightly process that backs up a mongo database. When it backs up it does a db.fsyncLock(), a LVM snapshot, a db.fsyncUnlock(), then does a tar -cvzf of the LVM snapshot, then releases LVM ...
1
vote
0answers
34 views

Proper way to create a compressed, rsyncable mirror of a directory?

I would like to create a compressed mirror of some directories in such a way that it can be rsynced again, both from the original destination and to a remote destination. I can do it inefficiently in ...
7
votes
1answer
71 views

How to get trailing data of gzip archive?

I have a gzip archive with trailing data. If I unpack it using gzip -d it tells me: "decompression OK, trailing garbage ignored" (same goes for gzip -t which can be used as a method of detecting that ...
0
votes
3answers
58 views

Delete last line of gz file

I need to delete the last line of gz file without uncompressing. The file has 500 lines. How can I do that? I have tried: gzip -dc "$files" | tail -500 | gzip -c > "$files".tmp But It doesn´...
0
votes
2answers
33 views

how to compress a folder without to leave the original folder and without to remove the original folder

under SQL directory we have only the tmp folder (tmp folder usage 59G) is it possible to compress the folder tmp without to leave the original tmp folder ? , so the compression will work on the ...
1
vote
2answers
40 views

Grep from a doubly-gzipped file

I have a file that is gzipped twice: test.gz.gz How do I grep something from the file above? I don't want to unzip it.
1
vote
3answers
70 views

gzip same input different output

Check out: data/tmp$ gzip -l tmp.csv.gz compressed uncompressed ratio uncompressed_name 2846 12915 78.2% tmp.csv data/tmp$ cat tmp.csv.gz | gzip -l ...
1
vote
1answer
45 views

How to decompress gzipped HTTP response?

File req contains the request header: GET /cd/E11882_01/server.112/e41084/toc.htm HTTP/1.1^M Host: docs.oracle.com^M Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8^M Accept-...
0
votes
0answers
20 views

Extract CSV gz file and convert to JSON

Is it possible to extract a CSV gz file stored on an external URL's public_html folder and then convert that data into JSON and then save it as .json in one command?
0
votes
0answers
23 views

The included VM could not be uncompressed (GZIP/UNCOMPRESS)

I have a .bin file to install Bladelogic NSH console and I want to install it in my OSX(Capitan). When I execute the .bin file in the Terminal I get the following error: Preparing to install... ...
4
votes
2answers
74 views

Print archive file list instantly (without decompressing entire archive)

A problem with .tar.gz archives is that, when I try to just list an archive's content, the computer actually decompresses it, which would take a very long time if the file is large. Other file ...
0
votes
1answer
36 views

have file tempfile2.gz (checked via file command) but gunzip/gzip -d does not work

I had a file (was a text file at first), did xxd -r to it and saved it to tempfile2. Afterwards did file tempfile2 and it wrote: tempfile2: gzip compressed data, was "data2.bin", from Unix, last ...
4
votes
2answers
72 views

Rename Multiple files gzips them and delete older than 10 days

I'm new to Linux/Unix and slowly learning it step by step. Unfortunately on today’s job interview was surprised by a task to do (which of course I didn’t know). I was asked to prepare a bash script ...
4
votes
3answers
364 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
45 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
21 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 /home/user/...
5
votes
3answers
429 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
127 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
43 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
46 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
49 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
50 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
72 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
95 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
825 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
71 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 this:...
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
107 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
605 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
108 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
143 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
306 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
69 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, ...
7
votes
0answers
299 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
52 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
35 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
118 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
231 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. I'...
5
votes
1answer
287 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
641 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
65 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 "./api/library/...
0
votes
2answers
53 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
351 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
42 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
31 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
201 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
423 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
419 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
3k 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 /...