Tagged Questions

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

learn more… | top users | synonyms

1
vote
1answer
175 views

Blocking gzip HTTP content with Iptables or Snort?

I'm looking to drop a connection if a website contains a certain word or phrase. The issue is, the site is typically compressed with gzip. Any ideas?
0
votes
1answer
137 views

How to safely enlarge a gzipped file?

I have a gzipped file (around 3Kb), and I want its size to be exactly 4000. To achieve this goal, is it safe to add trailing padding with zeroes? (By safe I mean that the content of the gzipped file ...
4
votes
3answers
2k views

How can I check if two gzipped files are equal?

I am trying to save space while doing a "dumb" backup by simply dumping data into a text file. My backup script is executed daily and looks like this: Create a directory named after the backup date. ...
0
votes
2answers
213 views

How to uncompress a gzip file with a custom extension?

I have a file called file1.atz. I know that it is gzipped. The uncompressed file extension should be .ats. I have read the man pages and I just want to verify I'm uncompressing this correctly, because ...
12
votes
5answers
21k views

tar: Removing leading `/' from member names

root@server # tar fcz bkup.tar.gz /home/foo/ tar: Removing leading `/' from member names How can I solve this problem and keep the / on file names ?
3
votes
2answers
9k views

Compress old log file into single zip-linux

I have a folder /home/testuser/log which contain log files of one day old *.log. I wish to compress all the log files older than one day to a single zip(gzip or tar.gz) and delete the older files. I ...
1
vote
1answer
302 views

mirror a site with wget that only response with gzip

I'm trying to mirror a site but the server only responses with gzip pages so wget won't recurse. I've searched around and there are some references to a patch to add gzip support to wget however they ...
4
votes
1answer
6k views

gunzip all .gz files in directory

I have a directory with plenty of .txt.gz files (where the names do not follow a specific pattern.) What is the simplest way to gunzip them? I want to preserve their original names, so that they go ...
1
vote
2answers
6k views

tar: Unexpected EOF in archive

I am trying extract .tar.gz file it but with no luck gzip: stdin: unexpected end of file tar: Unexpected EOF in archive tar: Unexpected EOF in archive tar: Error is not recoverable: exiting now the ...
0
votes
1answer
2k views

bash script to gzip files

I have to make a bash script that do a gzip of a file if is older than 60 days, and move it in a subdir which name is the beginning of the filename. Here an example of the files I have to work with: ...
3
votes
1answer
480 views

tar: exclude gzip file, and don't try to gunzip it

I would like to skip a large gzip file when I extract a tar file, but everytime tar starts to gunzip it to look inside it seems. Even when I just try to peek inside tar seems to start gunzipping it, ...
2
votes
1answer
595 views

Subprocess.call() and gunzip error

I'm trying to use Python's package subprocess to gunzip and gzip files. I'm using the following command: subprocess.call(['gunzip', a_path+myfile_gz], shell=True) Then I get the error message: ...
43
votes
3answers
32k views

How to tell gzip to keep original file?

I would like to compress a text file using gzip command line tool while keeping the original file. By default running the following command gzip file.txt results in modifying this file and renaming ...
3
votes
1answer
3k views

Gunzip multiple files and rename them

I want to know whether it is possible to gunzip multiple files and rename them with one command/script. I have a bunch of files in the format: test.20120708191601.DAT.3599502593.gz ...
3
votes
2answers
753 views

Search for files with a specific size inside recursive zipped archives

I have a folder with several files. These files are either .xml or .zip files. These .zip files contain .xml and/or .zip files. These .zip contains also .xml or .zip, and so on... until we finally ...
7
votes
3answers
11k views

Is it possible to compress a very large file (~30 GB) using gzip?

Is it possible to compress a very large file (~30 GB) using gzip? If so, what commands, switches, and options should I use? Or is there another program (preferably one commonly available on Ubuntu ...
5
votes
5answers
2k views

Unix bash script check empty gz files

I'm trying to write a bash script that will go into a directory loop through the .gz files and delete them if they are empty (ie the uncompressed file contained within in empty. I've got a couple of ...
-5
votes
2answers
3k views

ungzip the gizpped war

I am totally new to linux. I have gzipped a war file like this gzip mytest.war. I try to ungzip it like it --ungzip mytest.war.gz, it said command can't be found. How can I ungzip it? Moreover, how ...
19
votes
1answer
23k views

How do you extract a single folder from a large tar.gz archive?

I am using this command on a 5GB archive tar -zxvf archive.tar.gz /folder/in/archive is this the correct way to do this? It seems to be taking forever with no command line output...
7
votes
2answers
7k views

gzip - redirection or piping?

I will be backing up a large (750GB) disk to an external USB disk using dd. Should I be using redirection or piping? Which is more efficient? Or is there a difference? Also, what is the best block ...
2
votes
2answers
2k views

Gzip decompress on file with other extension?

Is it possible to use gzip to decompress a gzipped file, without the gz extension, and without moving the file?
0
votes
0answers
48 views

Backing up to DVD [duplicate]

Possible Duplicate: Splitting large directory tree into specified-size chunks? I have a partition that is about 14G and I need to back it up to DVD in such a way that I can use each disc to ...
4
votes
1answer
4k views

Will tar -cvzf packed.tar.gz mydir take hidden files into account?

I need to create a tarball of a given directory. However, I need to make sure hidden files are included too (such as those beginning with .). Will the following command automatically take the hidden ...
13
votes
2answers
2k views

Why does the gzip version of files produce a different md5 checksum

I have four files that I created using an svndump test.svn test2.svn test.svn.gz test2.svn.gz now when i run this md5sum test2.svn test.svn test.svn.gz test2.svn.gz Here is the output ...
1
vote
3answers
1k views

unzip a file from another folder

How can I unzip a file from another folder? gunzip -d /home/tomcat_dev/HN/radd/input.txt.gz unzips that file to the same folder. But if I want to bring it to my folder? When I do this: gunzip -d ...
0
votes
2answers
893 views

Combination of ls, xargs and zcat leads to duplicate file name suffixes?

Disclaimer: Yes, finding files in a script with ls is bad, but find can't sort by modification date. Using ls and xargs with echo everything is fine: $ ls -t1 ssl-access*.gz | xargs -n 1 echo ...
8
votes
4answers
13k views

How to uncompress zlib data in UNIX?

I have created zlib-compressed data in Python, like this: import zlib s = '...' z = zlib.compress(s) with open('/tmp/data', 'w') as f: f.write(z) (or one-liner in shell: echo -n '...' | python2 ...
6
votes
6answers
13k views

How can i view the contents of a tar.gz file (filenames + filesize)

I cannot use tar -tz as the solaris version I'm using does not accept the -z option. I tried something like gunzip file.tar.gz | tar -tv but that only gives: tar: /dev/rmt/0: No such file or ...
3
votes
3answers
6k views

How to recover a corrupted “tar.gz” file

I suddenly needed to recover an old tar.gz file, but as soon as I execute so: tar -zxvf filename.tar.gz I get this: gzip: stdin: invalid compressed data--format violated tar: Child returned ...
4
votes
2answers
935 views

diff a gzipped tarball against a directory?

Is there a way I can diff a gzipped tarball against an existing directory? I would like to be able to do it without extracting the data from the tarball.
2
votes
1answer
710 views

Recursively Gziping Files (and keep original files) & Gziping Text Input

I need Gzip to pre-zip some static files for a webserver I'm building. All of the files I need to gzip will be in a folder named .cache. Since some clients may not accept responses that are gzipped, I ...
8
votes
4answers
4k views

tar extraction depends on filename?

I often download tarballs with wget from sourceforge.net. The downloaded files then are named, e.g ...
21
votes
3answers
46k views

Add/update a file to an existing tar.gz archive?

Is there a way to add/update a file in a tar.gz archive? Basically, I have an archive which contains a file at /data/data/com.myapp.backup/./files/settings.txt and I'd like to pull that file from the ...
0
votes
1answer
46 views

Configure webserver for compression

Based on this page: http://code.google.com/speed/page-speed/docs/payload.html#GzipCompression I need to enable compression on my website, but I have no idea how to do this. If this is the right ...
5
votes
4answers
2k views

How can I check if a gzipped file is empty?

Is there a quick way to check if a gzipped file is empty, or do I have to unzip it first? example: $ touch foo $ if [ -s foo ]; then echo not empty; fi $ gzip foo $ if [ -s foo.gz ]; then echo not ...
3
votes
1answer
2k views

initramfs image compression other than gzip

can the initramfs image be compressed by a method other than gzip, such as lzma?