2022 Developer Survey is open! Take survey.

Questions tagged [gzip]

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

Filter by
Sorted by
Tagged with
-2 votes
3 answers
46 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 ...
user avatar
  • 21
8 votes
3 answers
807 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 -> ...
user avatar
  • 1,832
0 votes
2 answers
35 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 ...
user avatar
0 votes
1 answer
83 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 ...
user avatar
0 votes
1 answer
51 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 ...
user avatar
  • 125
4 votes
3 answers
166 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 ...
user avatar
5 votes
1 answer
174 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, ...
user avatar
  • 153
1 vote
1 answer
29 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&...
user avatar
2 votes
1 answer
285 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 ...
user avatar
  • 163
-1 votes
1 answer
94 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 ...
user avatar
0 votes
0 answers
78 views

How to open a tar file without using tar xfvz command line?

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:...
user avatar
0 votes
1 answer
21 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?
user avatar
0 votes
1 answer
50 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' /...
user avatar
  • 1
2 votes
2 answers
237 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 ...
user avatar
  • 241
1 vote
0 answers
34 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 ...
user avatar
0 votes
1 answer
26 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 ...
user avatar
  • 24.2k
0 votes
1 answer
52 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 ...
user avatar
  • 101
0 votes
0 answers
93 views

Combine .gz file with .tsv file (columns) using command line

I have two files. .gz file with with dimensions 12m x 5 columns .tsv file (no compression) with the same 12m rows and 9 more columns I normally would do this in R where I would read in both objects, ...
user avatar
0 votes
2 answers
85 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 ...
user avatar
0 votes
1 answer
107 views

1TB drive compressed shows only 3.8GB, what did I do wrong?

On Linux Mint 20.2 Cinnamon I would like to create a disk image of my secondary disk drive (SATA) containing Windows 10, not that it matters now, directly gzip'ed using the Parallel gzip = pigz onto ...
user avatar
0 votes
1 answer
27 views

File with div.gz extension (mistake?)

I tried downloading a zipped folder from Arxiv (https://arxiv.org/format/math/0606086 under DVI) but it downloads as div.gz. I understand that this is the TeX output. I tried TeX and various unzip ...
user avatar
0 votes
1 answer
32 views

Getting rid of spurious directories with tar -xzvf, while gunzipping

I want to trim the path of the gunzipped tarball so that some "spurious" leading directories are excluded. Let me explain with an example. I have the following directory structure, as ...
user avatar
  • 3
1 vote
1 answer
90 views

How to split, add text for each split and gzip file

I want to take a huge file data.txt and: Split it by 256m Add the first 3 lines of data.txt to each split file gzip it data.txt looks like: aaa bbb ccc <data> <data> <data> ... <...
user avatar
  • 1,135
3 votes
1 answer
273 views

Fastest way to find lines starting with string in gzip file

I have a flat database based on 65536 files, each one containing one word by line starting with two hexadecimal characters. They look like this: afword 46word2 Feword3 ... I make tens of thousands of ...
user avatar
  • 71
0 votes
0 answers
273 views

unzip xxx.csv.gz to PROCEDURES_ICD.csv

I would like to unzip a .csv.gz file to .csv. I cannot directly unzip because it will conduct an error: unable to expand (error 79: inappropriate file type or format). I tried the endorsed answer in ...
user avatar
0 votes
1 answer
468 views

can't uncompress a gzip compressed data

I have extracted a file 'linux' from ubutu installation .iso file. The command file linux gives me this output. linux: gzip compressed data, was "vmlinuz-5.4.0-42-generic.efi.signed", last ...
user avatar
  • 269
0 votes
1 answer
40 views

How to gzip all .BRIK in all Sub-Directories

I have a lot of files with .BRIK extension that take up a lot of space and need to be gzip. However, the files are scattered in multiple folders and few-level deep. I cannot find an answer to gzip *...
user avatar
0 votes
1 answer
56 views

gzip, send to server, ungzip

I am working on a script to backup and gzip a set of MySQL tables, scp/ssh them to a different server and then unpack them current script is: #!/bin/bash DATE=`date +"%d_%b_%Y_%H%M"` ...
user avatar
0 votes
0 answers
38 views

help with the firmware file of the radio

help with the firmware file of the radio. I unpack the file with the 7zip program, with the same program I can not return the file back to its original state with the same file size. https://cloud....
user avatar
2 votes
1 answer
602 views

tar xf command giving file not found

I am trying to extract one file out of the whole tar.gz and it's not working. Below are the commands i tried to simulate the issue mkdir test touch test/version.txt echo "1.0.2" > test/...
user avatar
  • 261
1 vote
1 answer
80 views

Modify the data type from .tar file and how to recover a corrupted one

Like the original question bellow, I need to recover a corrupted tar file. But after run: file file.tgz I got this return: file.tgz: data My question is about this return above and how to change ...
user avatar
0 votes
0 answers
69 views

Compression vs. redundancy: do they cancel each other out?

Does it make sense to compress a tarball (or any kind of file, really), e.g., using gzip or bzip2, while at the same time creating redundancy files for it, e.g., a par2 file? The context is that I am ...
user avatar
1 vote
0 answers
25 views

What will happend if run this command `gzip -r filename .`?

I ran this gzip -r filename . It zipped filename to fielname.gz and all the .(dotfiles/hidden files) in all the directories. Is this the expected behaviour? How to undo gz of .(dotfiles/hidden files)?...
user avatar
1 vote
2 answers
80 views

Uncompressed files by content double gzipped by mistake

I have some files that I gzipped twice by mistake with no file extension For example gzip -dc file outputs some binary gibberish for some of the files and for some other files it's okay I would like ...
user avatar
  • 111
1 vote
1 answer
249 views

How to uncompress a gzipped partition image and dd it directly to the destination partition without writing to current partition?

I've backed up a partition using sudo dd bs=8M if=/dev/sda2 | gzip > /someFolderOnSDB/sda2.img.gz. The image is stored on a separate disk sdb. When restoring it using gunzip -k /mnt/bkp/sda2.img.gz ...
user avatar
  • 315
0 votes
1 answer
63 views

Compressing multiple files to .gz misbehaving

I had 100 images from a Raspberry Pi project and in order to transfer them to another computer, I used the "Compress" interaction after selecting all of the images and using the right click ...
user avatar
  • 111
0 votes
1 answer
26 views

What would the value of hyphen actually look like in this instance used to refer to stdin for this archive command?

I am following a guide to learn terminal commands and have encountered the use of hyphens to refer to stdin in the following command used to find all files named 'file-A' within the directory ...
user avatar
  • 115
13 votes
8 answers
10k views

How to gzip 100 GB files faster with high compression

We have 100+ GB files on a Linux machine, and while trying to perform gzip using below command, gzip is taking minimum 1-2 hours to complete: gzip file.txt Is there a way we can make gzip to run fast ...
user avatar
  • 349
0 votes
2 answers
554 views

Gzip of folder while retaining original timestamp

I want to do gzip of folder, and also want to retain original timestamp for that folder. Can someone suggest any way around it. i tried below mentioned code. The timestamp which i am getting the time ...
user avatar
0 votes
1 answer
229 views

Split file from a streaming output with custom name and gzip

I have a script with a while loop that will print a text. I want to save it into files with custom name. Script: #!/bin/bash while true do echo "Press [CTRL+C] to stop.." done I can run ...
user avatar
1 vote
1 answer
383 views

Updating a large compressed file without creating temp file

I'm trying to figure out a way that I can update a compressed file (currently using zip, but am open to tar/gz/bz derivatives too) on a linux server without creating a temp file for the file to be ...
user avatar
0 votes
0 answers
41 views

294GB tar file, what are foreseeable problems?

In rhel 7.8 I have a folder called /study that has a bunch of data. It was ~500GB in size. I did gzip -9r /study and it reduced that folder to 294GB as reported by du -sh /study I then did tar -cf ...
user avatar
  • 4,121
11 votes
2 answers
2k views

How portable is a gzip file over 4 GB in size?

To backup a snapshot of my work, I run a command like tar -czf work.tgz work to create a gzipped tar file, which I can then drop in cloud storage. However, I have just noticed that gzip has a 4 GB ...
user avatar
  • 213
2 votes
0 answers
2k views

Correct/fix "gzip: stdin: unexpected end of file" in .gz file?

I use adb backup to backup my Android smartphone; and as noted in many posts, such as https://stackoverflow.com/questions/18533567/how-to-extract-or-unpack-an-ab-file-android-backup-file - I have ...
user avatar
  • 6,186
0 votes
2 answers
60 views

What does gzip < my file.gzip > do?

I am playing around with Linux and came across gzip < my file.gzip >, and I wonder what it does. Can someone tell me what it does?
user avatar
0 votes
1 answer
369 views

How to extract a compressed tar using cpio to a particular directory location

I created the compressed tar file using the below command. find /app/jboss -not -name "*.err" -not -name "*.log" | cpio -o | gzip >/app/patchbkp/test/REDHAT_jboss-eap-7.2_18-Aug-...
user avatar
  • 297
0 votes
0 answers
208 views

gzip -t output "gzip: filename.gz: extra field of X bytes ignored"

I have a bunch of .gz files I'm checking the integrity after data transfer with gzip -t -v file the output I'm getting is gzip: C2_CRRA200017850-1a_H3LJWDSXY_L1_2.fq.gz: extra field of 6 bytes ignored ...
user avatar
3 votes
2 answers
7k views

How do I gunzip to a particular directory?

I have .gz file like BIG5.gz. I want to gunzip this .gz file to the directory BIG5. This did not work: gunzip -c BIG5.gz > /BIG5
user avatar
  • 49
1 vote
2 answers
87 views

Help in creating script

I am currently working on script with the following goals: Script will check every 15-minute if there is AppA.log4 in /logs directory. There are numerous apps in /logs directory, for example AppA....
user avatar
1 vote
2 answers
68 views

How to gzip specific files in a certain folder?

Good Day. I am creating a script that moves all 'logA' files in a certain folder and adds timestamp every 3 hours, afterwards it will be zipped. This is the base of the script: cd /logs mv *logA+...
user avatar

1
2 3 4 5
8