Linux file compression: Difference between revisions

From Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 25: Line 25:
</pre>
</pre>


To decompress a 7-zip file (may need to install <code>p7zip</code> package):
To decompress a 7-zip file (may need to install <code>p7zip-full</code> package):
<pre>
<pre>
7za file.7z
7za file.7z
</pre>
</pre>

Revision as of 21:50, 19 August 2013

Note: tar and zip -r operate similarly on directories; they wrap an entire directory into a single compressed archive file. gzip -r, on the other hand, recursively goes through the directory structure and compresses individual files, replacing them with their .gz counterparts.

Please see specific man pages for the following:

To decompress a .Z file:

uncompress file.Z

To decompress a .bz2 file:

bunzip2 file.bz2

To create a jar archive from all class files in the current directory:

jar cf new-archive.jar *.class

To decompress a jar file:

tar xf file.jar

To decompress a 7-zip file (may need to install p7zip-full package):

7za file.7z