Questions tagged [gzip]
A data compression program. Originally a GNU utility it has been cloned by most Unix variants.
382
questions
0
votes
1
answer
27
views
"Permission denied" error when using sudo for writing image to /dev/sdb on Debian [duplicate]
I am confused as to why I am getting the following error:
$ sudo zcat firmware.A20-OLinuXino-Lime2.img.gz partition.img.gz > /dev/sdb
bash: /dev/sdb: Permission denied
Shouldn't sudo be able to ...
0
votes
0
answers
29
views
vmlinuz to vmlinux ERROR
$ file vmlinuz
vmlinuz: Linux kernel x86 boot executable bzImage, version 4.14.244 (root@d0ea4514eda5) #1 SMP Thu Aug 31 01:23:02 PDT 2023, RO-rootFS, swap_dev 0x3, Normal VGA
I try to use ...
0
votes
0
answers
29
views
Recoverably recompress gzip files into zstd, preserving original checksums?
I need to archive a lot of gzip-compressed data. The problem is that compared to zstd, gzip is wasteful, both in terms of ratio and CPU time required to decompress the data. Because of that, I want to ...
0
votes
2
answers
79
views
tar: ./.tar.gz: file changed as we read it | "Flagged" files are unrelated to the file tar is supposed to operate on
I am trying to use tar to recursively compress all files with the .lammpstrj extension within the directory tree starting at the directory whose path is stored in the variable home. home contains the ...
0
votes
2
answers
141
views
extending recursive find to .tar, tar.gz, tar.bz2, and tar.xz on Debian 12
Continuing find a file within a tar.gz archive, how is it possible to automatically recursively search for files with given names, including the files inside the archives and compressed archives?
For ...
0
votes
1
answer
67
views
How to verify size of pigz (parallel gzip) archive contents? [duplicate]
I created some pigz (parallel gzip) - home page - compressed archives of my SSD disk drives. (compiled version 2.8)
I called one of them 4TB-SATA-disk--Windows10--2024-Jan-21.img.gz which says the ...
2
votes
4
answers
223
views
awk appends column in .gz file as seen with cat -A, but changes column name in regular output
Using awk, to this table I want to add a column where first row is "INFO" and rest of the rows are all "1".
$ gunzip -c foo.gz | head
SNPID CHR BP Allele1 Allele2 Freq1 Effect ...
0
votes
0
answers
818
views
telegram-desktop: qt.svg: Error while inflating gzip file: SVG format check failed
I use telegram-desktop on arch linux in sway. It sometimes crashes, so I started it from terminal. This way I find out telegram spams this message:
qt.svg: Error while inflating gzip file: SVG format ...
2
votes
2
answers
2k
views
How to modify a gzipped file with sed and then zip again the file?
I have a .vcf.gz file, with the following aspect:
#CHROM POS ID REF ALT
chr1 10894 chr1:10894:G:A G A
chr1 10915 chr1:10915:G:A G A
...
0
votes
2
answers
674
views
How can I fix a .tar.gz being downloaded as html?
I'm trying to download this file https://www.apache.org/dyn/closer.cgi/hadoop/common/hadoop-3.3.6/hadoop-3.3.6.tar.gz with wget. When I try to unpack it with tar I get the following error:
gzip: stdin:...
-1
votes
1
answer
49
views
How can I evaluate tars and gzips for validity without expanding them?
LONG ago I wrote a backup script for our site and have updated it ever since. However, occasionally things go wrong and some of the older backups are now broken.
In days gone by I had used the utility ...
0
votes
0
answers
1k
views
How to extract .gtar file?
I have a .gtar file, I wanted to extract it, but it is not getting extracted.
Below are the methods I have tried with its output. I supposed to be contained bunch of text files.
$ gtar -xf file.gtar
...
4
votes
2
answers
858
views
Rename .gz files according to names in separate txt-file
I want to rename .gz files according to names in separate txt-file.
I have a map with .gz files with the names:
trooper10.gz
trooper11.gz
trooper12.gz
etc.
and I have a separate txt-file with the ...
1
vote
1
answer
2k
views
Normal gz file not extractable by tar [duplicate]
I have a gz archive but for some reason tar said that the format is incorrect even though I can double click it in mac Finder and extract it normally, and file command shows the same format just like ...
0
votes
1
answer
308
views
Extract first n bytes from .tar.gz and output as a .tar.gz in a single command
I have a .tar.gz as input and want to extract the first 128 MiB of it and output as a .tar.gz in a single command. I tried:
sudo tar xzOf input.tar.gz | sudo dd of=output bs=1M count=128 iflag=...
5
votes
1
answer
5k
views
Difference between ar, tar, gzip, zip and when should I decide to choose which one?
I had a use case where I needed to pack a bunch of files into one. And all above commands does the same. I know gzip compresses my files but lets say space is not at all an issue for me then in that ...
1
vote
0
answers
156
views
Patch compressed file
is there any way to patch a file, that is compressed via gzip without decompressing it first? I tried
patch -n <(gzip -d file.gz) patch_to_file.diff > new_file
but I only got
patch: **** Can't ...
0
votes
1
answer
306
views
Archive verify `gzip -v -t` prints success to stderr or I'm doing something wrong? [duplicate]
I want to add gzip file verification to my backup script.
My backup script creates logs for stdout and stderr like this:
scp -i $BCKIDENTITYFILE $BCKLOG "$BCKREMOTEUSER"@"$BCKHOST":...
1
vote
0
answers
576
views
tar not working with sudo
I am trying to extract a file into /usr/local/ using
$ sudo tar -xvzf /home/vyom/Downloads/go1.19.4.linux-amd64.tar.gz -C /usr/local/
tar (child): gzip: Cannot exec: No such file or directory
tar (...
0
votes
3
answers
82
views
Is it wrong to do tar czf somename.tar some_*_files?
Is it wrong to do tar czf somname.tar some_*_files instead of tar czf somname.tar.gz some_*_files, then of course tar xf somename.tar? That is : without adding the .gz extension.
This question is ...
0
votes
1
answer
209
views
How to backup many large files to single compressed file on S3
I have an application that has many thousands of files totaling over 10TB.
I'd need to backup this data somewhere (probably to AWS S3).
I'd like to:
compress data being backed up
save the backup as a ...
1
vote
1
answer
78
views
Untar file tar compressed file to different directories [duplicate]
I have a .tar.gz file which may have the following files:
folder1/folder2/folder3/imp_folder1/file11.jpg
folder1/folder2/folder3/imp_folder1/file12.jpg
folder1/folder2/folder3/imp_folder2/file21.jpg
...
0
votes
1
answer
2k
views
Why tar command uses gzip command through 'z' option?
In Linux Ubuntu about the 'tar' command for these versions:
tar -tzf /path/to/filename.tar.gz # Show the content
tar -xzf /path/to/filename.tar.gz # Extract the content
Observe both commands use ...
0
votes
1
answer
2k
views
Unzip compressed dump and import via psql
I'm trying to dump a huge database and compress the dump in order to not have to wait hours till it's done.
I dump the database the following way:
pg_dump -Fc -U -v | gzip > db$(date +%d-%m-%y_%H-%...
3
votes
2
answers
994
views
gunzip multiple gz files with same compressed file name in multiple folders
I have a directory where there are multiple folders, each folder contains multiple .gz files with the same zipped file name "spark.log". How can I unzip all of them at once and rename them ...
1
vote
1
answer
269
views
Sequentially extract files from a tar.gz file
I have a large tar.gz file with 122000 files that I'm downloading from the web to a compute resource that is limited to 14GB. The tar.gz is 3.3GB and the fully extracted archive is 29GB. I know I can ...
2
votes
1
answer
280
views
Convert dos line endings in .gz zipped file faster
I have 120 .gz files (each about 5G) with dos line endings, my goal is to convert those to unix line endings, but I don't want to wait multiple days.
Here is my current approach:
function conv() {
...
1
vote
0
answers
603
views
Compressing small files with gzip makes its size smaller than with bzip2, why? [closed]
I have a question, just a little thing couch my eyes
it's about compression with gzip and bzip2:
If I understood correctly - bzip2 requires more processing power but compresses files smaller and more ...
1
vote
1
answer
427
views
Why GZIP utility cares about extension?
Whenever I need to decompress a file which was compressed with Gzip, I need to rename the file with a .gz extension , I tried other compression utility like zip, bzip2 and they don't seem to care ...
0
votes
3
answers
1k
views
Gunzip extract *.gz files to another location
This code was written to extract multiple .tar files to another location and woks fine
ls -1 ${short_filename} \
| while read file; do \
tar -zxvf "$file" -C ${pentaho_temp_path}/${...
0
votes
2
answers
2k
views
Pipe find list of files into xargs gzip and pipe again into pigz
I need to find files newer than x days, and then turn it into a gzip, but I want to do it using pigz.
For now I'm now doing it the slow way; this works:
find /path/to/src -type f -mtime -90 | xargs ...
0
votes
0
answers
949
views
Unable to decompress gzip file ("not in gzip format")
I've been tasked with diagnosing an issue with a webpage, and I've been able to trace the issue back to a gzip'ed JavaScript file, jquery.min.js.gz. To view the code, I've downloaded and attempted to ...
0
votes
3
answers
15k
views
Creating a tar.gz archive of multiple directories of different locations -- "tar: Cowardly refusing to create an empty archive"
I'm trying to create an achive:
$ cd /tmp
$ tar -czf test1.tar.gz -C ~/Downloads/dir1 -C ~/Documents/dir2 -C ~/dir3/dir4/dir5
... which is supposed not to preserve the full path of the directories in ...
9
votes
3
answers
5k
views
tar.gpg vs tar.gz.gpg
Is it redundant to compress a tar archive before encrypting it using GPG? From my understanding, GPG will compress the file that it encrypts. Is it preferable to do tar -> gpg instead of tar -> ...
0
votes
2
answers
778
views
Compress several files according to the pattern
I would like to know how to compress several files according to the pattern using gzip, tar, etc... that is, if I have these files:
server_regTCA.log.2021.02.12
server_regTCA.log.2021.02.13
...
0
votes
1
answer
802
views
Reading multiple zipped files in awk script
I have an awk script named text_processing.awk . I need to pass multiple zipped files named 01JAN21.txt.gz , 02JAN21.txt.gz etc. to this script for further processing. The output file takes the date ...
1
vote
1
answer
417
views
How to extract specific file from partially downloaded tar?
I have a large tar file but it could not be downloaded completely as the browser crashed when verifying the download. Is it possible to extract some files from this tar?
I am able to view the files ...
4
votes
3
answers
1k
views
Un-concatenate gzipped file
The other day I was collecting some logs from a remote server and unthinkingly gzipped the files into a single file, rather than adding the directory to a tarball. I can manually separate out some of ...
5
votes
1
answer
1k
views
Can gzip -t detect 100% of truncated-download errors?
Scenario: a single 1g CSV.gz is being written to an FTP folder. At the same time, my client machine connects over sFTP to that folder and attempts to pull it down.
Q: After fetching that file, ...
1
vote
1
answer
66
views
Archive directory with tar/gz to multiple locations and omit an additional copy
I have a simple backup script, which also creates a tar/gzip archive of local data to an external USB device and then copies that archive to a second USB device.
For example:
usb1="/mnt/usbone&...
2
votes
1
answer
753
views
How do I decompress a folder of files that I accidently saved as foldername.gz instead of foldername.tar.gz
I'm not sure how I did this. I had to wipe my dedicated server and start again, so I backed up everything to a remote VPS first; during this process, I compressed a folder full of other folders as ...
-1
votes
1
answer
664
views
Pick random line from a compressed text file with zcat/gz or altnernatives
I have a simple bash script that picks a random line from a text file. This is originally done with shuf file.txt | head -1 (the same result can be achieved with cat file.txt | shuf | head -1). I also ...
0
votes
1
answer
8k
views
"gzip: stdin: invalid compressed data--format violated" error when extracting a tgz archive
I have to open a tar file. I used the following command line on my Unix shell:
tar xfvz raw-GWA-data.tgz
I found the following error message:
gzip: stdin: invalid compressed data--format violated
tar:...
0
votes
1
answer
71
views
What is the difference between Gzip and SZ error-bounded Lossy compression
I'm asking on the difference between Gzip and SZ error-bounded lossy compression and is there any relation between these compressors?
0
votes
1
answer
181
views
How to zgrep and then gzip multiple files individually?
I have the following code which searches for a term in multiple files (file1.json.gz, file2.json.gz, etc etc) using zgrep, and then using gzip it saves the output into a single file:
zgrep -i 'help' /...
3
votes
2
answers
927
views
Tarring-gzipping only hidden directories (or files + directories)
Based on this, to tar all hidden files in the current directory one can use
ls -A | egrep '^\.' | tar cvf ./test.tar -T -
However, how can one tar only all hidden directories or all hidden directories ...
1
vote
0
answers
730
views
How to tar-gzip a directory and put it in the /tmp
Hey im stuck on a assignment and i dont know how to solve it really because iam quite new with working in linux. I have to place a directory in a tar-ball and zip it using gzip.
At the moment this is ...
0
votes
1
answer
225
views
Is it efficient to archive-n-compress or compress-n-archive storage size-wise?
I'm trying to archive old files (1000+) and thinking of two options
gzip individual files and then create a zip
create gzip using tar cvzf on group of files
Not sure what would be most efficient ...
0
votes
1
answer
759
views
Create set of fixed sized compressed files from a large number of files
I have set of large number of files to be archived in a linux server. I need to compress those files in to set of 1GB compressed files.
I am using gzip to compress the files but I don't know the final ...
0
votes
2
answers
531
views
I cannot untar a zip file keep getting error
From the link below I try to follow the steps and I got the curl portion to work but when I type
tar zxf admit.tar.gz
I get
tar: Unrecognized archive format
tar: Error exit delayed from previous ...