A data compression program. Originally a GNU utility it has been cloned by most Unix variants.
4
votes
3answers
113 views
Efficiently remove file(s) from large .tgz
Assume i have an gzip compressed tar-ball compressedArchive.tgz (+100 files, totaling +5gb).
What would be the fastest way to remove all entries matching a given filename pattern for example ...
4
votes
2answers
42 views
Extract timestamp from a gzip file
How can I know the raw original timestamp of a file foo compressed with gzip without having to decompress foo.gz?
gzip --verbose --list foo.gz and file foo.gz will print formatted date and time.
11
votes
2answers
366 views
Is there a tool that combines zcat and cat transparently?
When handling log files, some end up as gzipped files thanks to logrotate and others not. So when you try something like this:
$ zcat *
you end up with a command line like zcat xyz.log xyz.log.1 ...
1
vote
1answer
59 views
gunzip multiple compressed files to another directory without deleting the .gz files
I have multiple .gz file in a folder and I want to unzip it in other folder through gunzip without deleting parent file. Please help.
1
vote
2answers
78 views
Chaining mysqldumps commands to output a single gzipped file
Let's say I have these series of commands
mysqldump --opt --databases $dbname1 --host=$dbhost1 --user=$dbuser1 --password=$dbpass1
mysqldump --opt --databases $dbname2 --host=$dbhost1 --user=$dbuser1 ...
7
votes
1answer
182 views
Under what circumstances does gunzip & tar xf work but tar xzf fail?
To illustrate the point: I have downloaded the LEDA library from the company's website. Using tar -xzf on it fails:
$ tar -xzf LEDA-6.3-free-fedora-core-8-64-g++-4.1.2-mt.tar.gz
tar: This does not ...
3
votes
8answers
1k views
Triple compression and I only save 1% in space?
I've been trying to save space on my linux server, and I had a folder containting, in subfolders, 22GB of images.
So I decided to compress them.
First I used tar:
tar -zcf folder.tar folder
Then ...
2
votes
1answer
229 views
How to create a gzip file without .gz file extension?
I would like to create a gzipped file that retains the original file name. For example gzipping "example.txt" should output a gzipped file named "example.txt" rather than "example.txt.gz." Is it ...
0
votes
1answer
179 views
How to disable gzip compression with wget?
There are other questions asking how to enable gzip compression with wget, and lots of web pages out there telling how to do this, but I need the opposite. I'm trying to locally mirror a site, and ...
2
votes
2answers
72 views
How to bzip a file with minimum cpu percentage?
I am using bzip2 to compress a file,the process takes more that 100% cpu.Is there any way to run bzip2 with minimum CPU precentage.
1
vote
1answer
120 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
64 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 ...
3
votes
3answers
238 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
80 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 ...
2
votes
4answers
2k 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 ?
1
vote
2answers
1k 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
133 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 ...
0
votes
1answer
572 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
1k 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
950 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
252 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
224 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:
...
14
votes
3answers
4k views
How 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
772 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
356 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 ...
5
votes
2answers
4k 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
805 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
945 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 ...
6
votes
1answer
6k 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...
6
votes
2answers
3k 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
535 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
45 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 ...
3
votes
1answer
2k 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 ...
6
votes
2answers
510 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
369 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
493 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
...
4
votes
4answers
4k 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 ...
5
votes
5answers
4k 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 ...
1
vote
2answers
2k 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
331 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
441 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 ...
7
votes
4answers
2k views
tar extraction depends on filename?
I often download tarballs with wget from sourceforge.net.
The downloaded files then are named, e.g ...
9
votes
2answers
19k 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
43 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 ...
4
votes
4answers
904 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 ...
2
votes
1answer
830 views
initramfs image compression other than gzip
can the initramfs image be compressed by a method other than gzip, such as lzma?