Questions tagged [compression]

Compression decreases the size of data.

Compression decreases the size of data, normally done to preserve space, archive old files or to reduce network bandwidth required while transmitting file. Compression can be applied to files, folders, disks and even whole disk arrays. A myriad of compression programs exist, each with their own advantages and disadvantages such as: compression ratio, speed of compression, and program comparability. Questions relating to specific programs that perform compression can be found under tags such as and even and

1202 questions
516
votes
6 answers

How to decompress a .bz2 file

I have a file as: filename.bz2 I need to decompress. I have tried the command: tar xvjf filename.tar.bz2, but it didn't work as the file is not a tar file. How do I decompress this file?
Jury A
  • 5,305
  • 2
  • 14
  • 5
308
votes
8 answers

How can I extract .rar files on the Mac?

Is there anything built-in that does this? (E.g. command line tools.) Or are there any third-party apps? Update: I like The Unarchiver, but vote up your favourite, or add it as an answer if it isn’t there.
Paul D. Waite
  • 6,434
  • 11
  • 49
  • 72
243
votes
15 answers

How do I extract files from an MSI package?

We have some old patches that we want to get the files from but don't wish to spend the time installing them to a machine. Can anyone advise a way to extract files from an MSI installation package?
Martin
  • 4,134
  • 6
  • 31
  • 33
243
votes
3 answers

Why are tar.xz files 15x smaller when using Python's tar library compared to macOS tar?

Context I'm compressing ~1.3 GB folders each filled with 1440 JSON files and find that there's a 15-fold difference between using the tar command and Python's built-in tarfile library on macOS or Raspbian 10 (Buster) Minimal working example This…
Saaru Lindestøkke
  • 5,515
  • 8
  • 30
  • 48
217
votes
6 answers

How to specify level of compression when using tar -zcvf?

I gzip directories very often at work. What I normally do is tar -zcvf file.tar.gz /path/to/directory Is there a way to specify the compression level here? I want to use the best compression possible even if it takes more time to compress.
Lazer
  • 17,227
  • 43
  • 116
  • 141
173
votes
8 answers

How is PNG lossless given that it has a compression parameter?

PNG files are said to use lossless compression. However, whenever I am in an image editor, such as GIMP and try to save an image as a PNG file, it asks for the compression parameter, which ranges between 0 and 9. If it has a compression parameter…
pkout
  • 1,881
  • 2
  • 12
  • 7
167
votes
5 answers

Compress files from OS X terminal?

In the Finder, there is this wonderful ability to right click on a file or directory, select compress from the drop-down, and end up with a zipped file. Is it possible to do the same thing from the terminal?
William Jockusch
  • 4,573
  • 10
  • 34
  • 44
151
votes
7 answers

Pros and cons of bzip vs gzip?

I've known gzip for years, recently I saw bzip being used at work. Are they basically equivalent, or are there significant pros and cons to one of them over the other?
ripper234
  • 11,323
  • 39
  • 89
  • 112
124
votes
1 answer

Cannot decompress .tar.xz file, getting "xz: Cannot exec: No such file or directory" from tar

Per How do I uncompress a tarball that uses .xz?, I tried tar xf php-5.6.0RC4.tar.xz and tar -xJf php-5.6.0RC4.tar.xz and in both cases I get the following: tar (child): xz: Cannot exec: No such file or directory tar (child): Error is not…
neubert
  • 6,863
  • 35
  • 76
  • 138
120
votes
4 answers

Creating an archive from a directory without the directory name being added to the archive

I have the following folder structure: root folder1 folder2 folder3 7za.exe I want to run the 7-zip command line tool to compress all the files in folder1 to a zip file called folder1.zip. Running the following 7za.exe a -tzip…
gg.
  • 1,303
  • 2
  • 8
  • 4
117
votes
6 answers

What are the best options to use when compressing files using 7 Zip?

I often have to gather log files and upload them to a central server (Owned by another company). The central server has a size limit of the file, so I am trying to create the smallest file possible that is still in the zip format. What are the best…
jjnguy
  • 1,827
  • 2
  • 15
  • 19
106
votes
4 answers

How to obtain maximum compression with .tar.gz?

The way i understand the use of tar + gzip is that tar is normally used to consolidate a grouping of files into a single file, then gzip is used to compress that file. I recently learned that tar can also compress. Because I do not fully understand…
Mario Zigliotto
  • 1,601
  • 3
  • 15
  • 12
106
votes
5 answers

Create a tar file for compressing files and directories on Mac OS X

I'm new to Mac OS X and am not sure how to do this: I have three directories. I want to create a tar/zip file of them so that I can attach them to an email. Any ideas?
sagarkothari
  • 4,925
  • 25
  • 72
  • 92
91
votes
21 answers

Compressing with RAR vs ZIP

A lot of people are compressing files with RAR, sending compressed files with RAR and so on. ZIP is more standard and works on all platforms. Windows users have ZIP included and Linux users have no trouble with that file format. The tests I did…
FerranB
  • 1,067
  • 1
  • 15
  • 24
90
votes
7 answers

Compress and then encrypt, or vice-versa?

I am writing a VPN system which encrypts (AES256) its traffic across the net (Why write my own when there are 1,000,001 others already out there? Well, mine is a special one for a specific task that none of the others fit). Basically I want to run…
Majenko
  • 32,128
  • 4
  • 61
  • 81
1
2 3
80 81