Linux file compression
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