Linux file compression: Difference between revisions

From Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
* [[tar]]
* [[tar]]
* [[zip]]
* [[zip]]
* [[7zip]]


To decompress a .Z file:
To decompress a .Z file:
Line 23: Line 24:
<pre>
<pre>
tar xf file.jar
tar xf file.jar
</pre>
To decompress a 7-zip file (may need to install <code>p7zip-full</code> package):
<pre>
7za e file.7z
</pre>
</pre>

Latest revision as of 18:06, 29 October 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