Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [gzip]

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

0
votes
0answers
27 views

Why I cannot tar gzip all the contents of a specific folder

I have a folder containing several folders. I want to tar and gzip the parent folder with all the contents of the subfolders. However, when I use tar -cvzf folder.tar.gz Folder/ only a few ...
0
votes
2answers
30 views

Is it possible to have a zipfile in which only some files where encripted/password protected?

Would like to create a default project structure, but some business areas of the company do not need to have access to some assets (so I wanna block them). Is there any way I could create a zipfile ...
-2
votes
1answer
50 views

Can I combine the tail and gzip commands inside a function? [closed]

I'm currently learning UNIX commands as part of my internship. Is there a way to combine these two commands-> (tailing log files then zips it using gzip)? My script is posted below: #!/bin/sh # ...
-2
votes
1answer
56 views

Replace a binary file within another binary file

Is it possible replace in place a binary file located inside another binary file? For example, compressed firmware.bin file contains: DECIMAL HEXADECIMAL DESCRIPTION ------------------------...
0
votes
1answer
24 views

Logrotate is not compressing

I need to compress the files in var/log/remots/*/* with the following logrotate rule /var/log/remots/*/* { rotate 178 daily maxage 178 compress } located in /etc/logrotate.d/remots. ...
2
votes
1answer
83 views

Best compression for operating system image

I have an Operating system image of size 2.5G. I have a device with a limited size. Thus I was looking for the best possible solution for providing the compression. Below are the commands and ...
2
votes
1answer
42 views

Trying to Create a TAR Archive, But Exclude .messages Files

I want to create a GZIP compressed TAR archive containing the contents of /var/log, but excluding /var/log/messages file. I tried tar -cvf var/log.tar var/log/ -x *.messages*, but got the error ...
1
vote
1answer
40 views

Is it possible to automatically zip newly created files in a directory

Context I am required to use a poorly designed java application that logs A LOT of information while it is running. Under standard usage, it will create 100s of MB of logs per hour. I don't need ...
0
votes
1answer
95 views

How to extract information using awk on .gz files without storing the uncompressed data on disk

I need to use this command: awk 'NR==FNR {a[$1]; next} $1 in a{print}' inputfile1.txt inputfile2.gen.gz >output.txt Awk doesn't read the .gz file. I have tried zcat inputfile2.gz | awk 'NR==...
2
votes
2answers
114 views

How can I tar and gzip my web directory files and download (using rsync) it in one command from my local machine?

I'm rewriting my original question because I realized this is more efficient: I'd like to tar and gzip my website files and then download it. I know I can tar and gzip it with one command using tar ...
0
votes
2answers
304 views

Can't tar files: Refusing to read archive contents from terminal

I have host without dpkg so I need to install it. I followed the instructions from here and here. On both of these answers they wrote that I need to download the file: wget http://security....
1
vote
1answer
53 views

Gzipped archives - Create using tar -czf and extract using only -xf?

Say I have a file.txt containing one line: strawberry Using tar -czf archive.tar.gz file.txt I can create a "gzipped archive" with the name archive.tar.gz, which is to my knowledge the equivalent ...
1
vote
4answers
57 views

Using an if statement to see if files are in a folder using a wildcard [duplicate]

I have to process multiple files that I dont have the entire name for. I am running an if statement using a wildcard. for example... if [ "ESGSN_*.SMS.EDR" ]; then echo "There are files to ...
1
vote
0answers
45 views

Need to edit a single file in a tar.gz using Python [closed]

Vim provides the ability to edit a single file in a tar.gz without unarchiving. ( i.e. vim some_archive.tar.gz ) How could I script the same type of operation using Python?
1
vote
1answer
48 views

Logs gzipped and not gzipped

Recently I've changed logs configuration for letsencrypt, because there was no given one and I have files: letsencrypt.log letsencrypt.log.1 letsencrypt.log.10 letsencrypt.log.10.gz letsencrypt.log....
-1
votes
1answer
34 views

Gzip verbosity goes to standard error

When I want to redirect any verbose output I usually do the following, [arif@arif test]$ rsync -v /home/arif/storage . 1> stdout [arif@arif test]$ cat stdout storage sent 177 bytes received 35 ...
1
vote
2answers
192 views

gzip multiple files and rename them

I have to gzip multiple files in a directory and rename them. I dont want to zip them into a single zip file. i.e. gzip: ABCDEPG01_20171120234905_59977 ABCDEPG02_20171120234905_59978 ...
1
vote
0answers
17 views

How can I revert zip files which are zipped using “gzip -r” [duplicate]

I intended to zip a directory, so I used: gzip -r myfolder When I checked the output, it has been zipped all the files within the directory and its subdirectories. It wasn't what I explected How ...
0
votes
3answers
307 views

Linux determine ZIP size without compression

I would like to make a ZIP file using zip command. Zip file would contain large number of directories containing large numbers of subdirectories, files etc. Is there any way to calculate final size ...
9
votes
1answer
720 views

Uncompressed file estimation wrong?

I had a large (~60G) compressed file (tar.gz). I used split to break it into 4 parts and then cat to join them back together. However, now, when I am trying to estimate the size of the uncompressed ...
0
votes
1answer
69 views

NGINX gzip per virtualhost?

I know here are a lot of "similar" Q's, but anyway... So – I have a nginx.conf with gzip on;. It's a new, clean Linux server, nothing yet done here. Using curl – I can see gzip enabled: $ curl -I -...
3
votes
2answers
122 views

Concatenate multiple zipped files, skipping header lines in all but the first file

I have a collection of gzipped files that I want to combine into a single file. They each have identical format. I want to keep the header information from only the first file and skip it in the ...
0
votes
2answers
721 views

Compression Utility Max Files Size Limit | Unix/Linux

In Unix/Linux is there any max files size limit that a compression utility ( gzip/compress) can compress. I remember years ago it was mentioned in the gzip page that it can compress files up to 4 gb. ...
4
votes
1answer
132 views

gunzip on Embedded machine

I'm using BusyBox 1.24.1 on my Embedded Linux machine (with kernel v3.10.31) and I get behavior I can't understand when unzipping files.  The gunzip command (often, but not always) fails, with no ...
4
votes
3answers
553 views

Why does a gunzip to dd pipeline slow down at the end?

my command: gunzip -c serial2udp.image.gz | sudo dd of=/dev/mmcblk0 conv=fsync,notrunc status=progress bs=4M my output: 15930949632 bytes (16 GB, 15 GiB) copied, 1049 s, 15.2 MB/s 0+331128 ...
0
votes
2answers
222 views

Does tar.gz do effective file compression of large files?

I wanted to compress a ~29GB file significantly, and used the tar command in the terminal like this : tar cvzf file.tar.gz /path/to/directory and it compressed it to ~26GB, so I looked up maximum ...
1
vote
1answer
38 views

perl symlink on gz file

I have a file file1.txt.gz and I am trying to create a symlink to a regular file as below using perl symlink ("file1.txt.gz", orig_file1); But this doesnt seem to work unless I add .gz suffix to the ...
0
votes
1answer
239 views

How could --compression be missing from my wget?

I have experience with the Windows version: GNU Wget 1.19.4 built on mingw32. But now on Ubuntu, I have: GNU Wget 1.19.4, a non-interactive network retriever. There is a relatively new option ...
1
vote
0answers
106 views

tar: Potential bug (?) when incremental archive selected - Deleting files in the target

I have quite interesting observation which perhaps is a manifest of a bug. My use case is to: take a backup of a folder, having a set of files from this folder added to --exclude-from file. I'm ...
3
votes
1answer
273 views

How to maintain sort order with xargs and gunzip

I'm attempting to extract the contents of some files by alphabetical (which in this case also means date and iteration) order and when I test the process first with ls: $ find /opt/minecraft/wonders/...
0
votes
3answers
559 views

How to tar-gzip a directory and put results inside itself?

I would like to backup my entire home directory on Linux. Suppose this directory is the only one I have write permissions to. How would I tar-gzip this directory and put result inside itself?
1
vote
1answer
1k views

How to turn a tar file to a tgz file?

I usually create a tgz file for my_files with the command tar -czvf my_files.tgz my_files, and extract them with tar -zxvf my_files.tgz. Now I have a tar file created with the command tar -cvf ...
3
votes
2answers
661 views

Archive big data into multiple parts

I'm working on big data and I need to archive a directory that is larger than 64 terabytes. I cannot create such large file (archive) on my file system. Unluckily, all proposed solutions for creating ...
1
vote
4answers
3k views

read first line from .gz compressed file without decompressing entire file

I have a huge log file compressed in .gz format and I want to just read the first line of it without uncompressing it to just check the date of the oldest log in the file. The logs are of the form: ...
-2
votes
2answers
315 views

Trying to gzip qcow2 files to a /backup directory

I have some files in a directory; some of them are .qcow2 extensions. I want to backup only the files having .qcow2 extension. Example: I have 5 files with .qc0w2 exxtension, they are: vm1.qcow2, ...
5
votes
2answers
859 views

How to correctly extract a .tar.gz with md5.sum on solaris 10

I am trying to extract a gcc-4.9.0.tar.gz downloaded from one of the gcc mirror site. In order to check the md5 signature on it before I gunzip it I did digest -a md5 -v gcc-4.9.0.tar.gz which ...
0
votes
1answer
46 views

Grepping account names (read from a file) from a set of compressed files

This script: while read ACCT ; do echo $ACCT zgrep -h ^$ACCT datafile.0[2-3]2015.gz >>/tmp/$ACCT.txt done < /account_list.txt I get no redirected output file When I remove '>>/tmp/$...
1
vote
1answer
3k views

Unzipping a .gz file to get a text file but getting a binary file? [closed]

I have a .gz file called document.txt.gz file. It is supposed to be a text file which got compressed to a gzip file. When I uncompress, I am getting a corrupt file. I ran the following commands: $ ...
0
votes
0answers
61 views

file ending .gz0 - which program does this?

On my Solaris 10 boxes, I have compressed log files with the ending .gz0. gunzip cannot unzip them, however if I change the ending to .gz, gunzip will unzip them, and these files appear to be empty. ...
2
votes
1answer
78 views

Finding the Count for a String on Multiple Zipped Files in Multiple Directories (non aggregated)

I'm trying to figure out the number of lines that contain the strings "event" and "type". The files I want to search through are in multiple folders and are zipped. I'm able to get an aggregated count ...
-2
votes
3answers
604 views

How to tar zip directories which are 7 days older

I have a folder that contains a lot of xml files stored in it, the folder name has a format 'yyyymmdd' eg., 20180515. I wanted a script that can zip the folder of this kind, when the folder grows 7 ...
0
votes
1answer
601 views

How to merge two gz files into new outputfile with specific name

I have 96 *fastqc.gz raw read files from 24 samples. Each sample was sequenced on two lanees for each pair. I would like to merge reads for each pair from both lanes into one output file with same ...
1
vote
2answers
603 views

compress file using /bin/gzip with particular patterns

I want to compress files individually with the particular pattern. For example, I have directory as below : /log/log1 -/1/log2/file.1 -/1/log2/file123 -/1/log2/file2.1 /log/log2 -/2/...
1
vote
1answer
218 views

Restore files from tar using rsync

I'm writing the software upgrade functionality for a piece of embedded equipment. Currently the root file system is upgraded by taking a new rootfs.tar.gz file and unpacking it to the root file ...
1
vote
1answer
44 views

How to remove parentheses from a compressed (preferably gzipped) text file

This question discussed how to remove parentheses from simple uncompressed text files. The accepted answer suggested the following: cat in_file | tr -d '()' > out_file To my observation, however,...
1
vote
2answers
321 views

How to turn gzipped file into one tar.gz archive in-place?

I have a lot (~5 millions) of small files, each one compressed individually with gzip. I would like to turn them into one big tar.gz archive to save some space (metadata), but there are limitations: ...
0
votes
2answers
445 views

tar command create directory without 777 permission

I run into an error while extracting a tar file, the created directory are created with the chmod 666 instead of 777. Therefore it will not extract inside this folder. Here is my command: $umask 000 ...
2
votes
1answer
464 views

Reading partially downloaded gzip with an offset

Let's say that there is one huge db.sql.gz of size 100GB available https://example.com/db/backups/db.sql.gz and the server supports range requests. So instead of downloading the entire file, I ...
1
vote
1answer
228 views

why does gzip not create files of equal size?

I have a file I need to split into smaller sizes (<24M when zipped) Heres the file: 498775505 Mar 8 00:08 test.file I split it: split -b 125000k test.file test.file. Now I have even sized ...
0
votes
1answer
315 views

gzip all files to root folder in .tar?

The command below will create a .tar.gz with another archive in it which contains the actual files. Is it possible to prevent the additional archive from being created and put all files directly ...