Questions tagged [gzip]

Open source command line data stream compressor and archiver.

122 questions
1050
votes
8 answers

What command do I need to unzip/extract a .tar.gz file?

I received a huge .tar.gz file from a client that contains about 800 mb of image files (when uncompressed.) Our hosting company's ftp is seriously slow, so extracting all the files locally and sending them up via ftp isn't practical. I was able to…
EmmyS
  • 14,720
  • 13
  • 39
  • 51
223
votes
3 answers

How do I compress a directory?

I'm trying to compress a directory and ftp it to a windows ftp. I have tried every tar command I can find to compress a directory. It appears to be ok. Then I transfer it and view it's contents using Winrar. Winrar keeps telling me the file is…
dko
  • 2,423
  • 2
  • 18
  • 15
71
votes
2 answers

Compress in .tgz

I want to compress files in .tgz. I know how to make tar.gz(with tar and gzip) and some people say it is almost the same, but I need to make a .tgz, how??
RocketMan
  • 981
  • 2
  • 7
  • 7
68
votes
2 answers

"less" doesn't automatically decompress gzipped files

On Fedora/Redhat/CentOS the less command seems to magically detect a gzipped file and decompress it on the fly, so you can do: less my_stuff.csv.gz I've just noticed this doesn't work on Ubuntu 11 less my_stuff.csv.gz "my_stuff.csv.gz" may be a…
AndrewR
  • 791
  • 1
  • 5
  • 7
41
votes
5 answers

What's the best way to use parallel bzip2 and gzip by default?

Bzip2 and gzip only use one core, although many computers have more than one core. But there are programs like lbzip2, pbzip2 and pigz, which use all available cores and promise to be compatible with bzip2 and gzip. So what's the best way to use…
elmicha
  • 9,250
  • 4
  • 31
  • 48
41
votes
2 answers

How do I gunzip all files recursively in a target directory?

I'd like to know what is the command to use to gunzip all files in a target directory recursively? I tried to use the unzip command but it didn't work. I tried the command from Unzip all zip files in a target folder?
user2028856
  • 1,081
  • 4
  • 13
  • 16
33
votes
3 answers

how can I extract multiple gzip files in directory and subdirectories?

I have tried both gzip and gunzip commands but I get either gunzip *.gz gzip: invalid option -- 'Y' gunzip -S-1800-01-01-000000-g01.h5.gz gzip: compressed data not read from a terminal. Use -f to force decompression. For help, type: gzip…
Herman Toothrot
  • 583
  • 2
  • 5
  • 10
23
votes
1 answer

Uncompress and pipe the output to script

I have a script that takes an input with a -i flag. The input file I have is compressed (.gz). What I want to do (not sure it's possible), because the file is huge, do some thing like this: gunzip -c myfile.gz | myScript.pl -i STDIN -o myoutfile.txt…
crysis405
  • 653
  • 1
  • 5
  • 10
20
votes
2 answers

How to uncompress a .bin.gz file?

I have a file named like file.bin.gz. I tried using gzip -d f.bin.gz to uncompress it, and got a .bin file. Is the correct way to uncompress .bin files to use gzip -d? Also, .bin is a binary file, right?
martin
  • 453
  • 2
  • 4
  • 7
20
votes
4 answers

Any linux command to perform parallel decompression of tar.bz2 file?

I have a rather large file (~50GB) and it takes some time to run tar xvf file.tar.bz2 on it. I'm aware of programs that can do parallel compression for bzip2 files but unaware of programs that can do parallel decompression for bzip2 files. Are…
user784637
  • 10,235
  • 19
  • 51
  • 56
18
votes
1 answer

Is it possible to pipe from stdin to gzip?

If I run the command s3cmd get s3://bucket/file.gz - I get binary output on the screen. If I try to pipe this to gzip with s3cmd get s3://bucket/file.gz - | zcat I get gzip: stdin: not in gzip format. How can I get zcat to pick it's input from…
KalenGi
  • 345
  • 2
  • 5
  • 9
18
votes
2 answers

Error, even with sudo: "dd: failed to open ‘/dev/sda1’: Permission denied" (dd input piped from gzip)

My command which doesn't work: sudo gzip -dc sda1.image.gz | dd of=/dev/sda1 returns the following error even before I've had a chance to enter my password: dd: failed to open ‘/dev/sda1’: Permission denied [sudo] password for ken: I've also tried…
Ken Conrad
  • 421
  • 2
  • 4
  • 8
18
votes
6 answers

gzip all files with specific extensions

I'm trying to gzip all files on ubuntu that have the file extension .css, .html or .js. in a top directory and all subdirectories. I want to keep the original files and overwrite the .gz file, if already existing. So when I have n files, I want to…
Sadik
  • 266
  • 2
  • 5
  • 20
18
votes
5 answers

Compressing videos create even larger file

I have been using the GUI (right click => compress) to try and compress a .tar containing 3 videos totalling 1.7gb (.H264 MP4s). gzip, lrzip, 7z etc. all do nothing to the file size and the compressed folder is also 1.7 gb. I then tried running…
Lee
  • 283
  • 1
  • 2
  • 5
16
votes
3 answers

curl .gz file and pipe it for decompression

I am trying to download some .gz files (N.B. not .tar.gz ones) from given URLs and decompress them to overwrite existing files, if any. For each individual download, I tried the following: curl -O $URL | gunzip -f However, this did not work as it…
skyork
  • 431
  • 1
  • 3
  • 7
1
2 3
8 9