Questions tagged [gunzip]

33 questions
248
votes
2 answers

Unzipping a .gz file without removing the gzipped file

I have a file file.gz, when I try to unzip this file by using gunzip file.gz, it unzipped the file but only contains extracted and removes the file.gz file. How can I unzip by keeping both unzipped file and zipped file?
jack
  • 3,853
  • 11
  • 28
  • 33
4
votes
2 answers

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 output (not even an error message), even when given a…
4
votes
1 answer

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

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: $ file document.txt.gz and the result is…
Morpheus
  • 163
  • 1
  • 2
  • 9
3
votes
2 answers

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 like the gz file? My data looks like this List of…
sojim2
  • 143
  • 5
3
votes
1 answer

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/logs/ -name 20* -type f -mtime -3 -print0 \ |…
2
votes
1 answer

GNU parallel + gunzip (or 7z, or bsdtar, or unzip): extract every "archivename.zip" into (to-be-created) its "archivename" subfolder

As in title. I've got a lot of ZIP archives that I want to extract. All archives have their own unique name. All archives contain files only (inside archives there are NOT folder(s) at all: no parent / main folder). I'd like to process all these ZIP…
T. Caio
  • 129
  • 1
  • 1
  • 7
2
votes
2 answers

UNZIP: Cannot find or open filename.zip Error

I have a zipped file (using Winrar) and the size of it is more than 4GB from Windows 10. I've already dumped the file in Unix Server and I want to unzip the file but the error always shows: Code: unzip filename.zip unzip: cannot find or open…
Ace
  • 65
  • 1
  • 2
  • 8
1
vote
2 answers

Gunzip all the files with a given extension in a different folder

I have a folder with 28 gz files with the extension .gz and 28 files with the extension .gz.bam. I would like to unzip all the 28 .gz files and send them to another folder. I was doing one by one as follows: gunzip -c file1.gz >…
1
vote
1 answer

How Can I Pipe the Sed Command?

I have a bash script that imports wordpress dbs for me pretty reliably, but one of my sites came from a former wordpress multisite, therefore the database includes DEFINERS within the database that prevents the following code from executing…
Time-Bandit
  • 202
  • 2
  • 10
1
vote
1 answer

What should dirname and basename be in this command?

With this command, we can recursively unzip archives in a directory and its sub-directories and remain its structure in the current working directory. find ../backUp/ -name "*.zip" | xargs -P 5 -I fileName sh -c ' unzip -o -d "$(dirname…
Maxfield
  • 151
  • 6
1
vote
1 answer

how to fix "tar: Cannot verify compressed archives" error?

I wanted to compress a directory into .tar.xz format and verify it after writing so I wrote a command like this: tar --xz --create --verbose --verify --file myArchive.tar.xz /patch/to/my/dir but it did not create archive and I got this two error…
mmj
  • 99
  • 2
  • 11
0
votes
0 answers

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 gtar: This does not look like a tar archive. gtar:…
0
votes
0 answers

unzip: can't set permissions of directory 'folder' : Invalid argument

I have the below script to unzip a .zip file and print out a .txt file of the files in the .zip but when I run the script, I get this output: "unzip: can't set permissions of directory 'folder' : Invalid argument" My script: for file in *.zip do …
Shortytot
  • 3
  • 2
0
votes
0 answers

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 unzip the file on my Linux machine. I'm met with…
0
votes
1 answer

For all zips, and unzip in working directory and maintains its structure

With this command find . -name '*.zip' -exec unzip '{}' ';' we find all zip files under . (directory), then unzip them into the current working directory, However, the structure is…
Maxfield
  • 151
  • 6
1
2 3