Ubuntu system under the compression file suffix has several tar,tar.gz,tar.bz2,zip, and so on, the file compression and decompression does not want Windows as convenient, directly right-click Compression or decompression. Ubuntu below for different compression suffix names need to be pressurized or decompressed with different commands.
1.. zip
Compression: Zip-r file.zip dir
Decompression: Unzip File.zip
2.. tar
Package: TAR-CVF File.tar dir
Decompression: TAR-XVF File.tar
TAR-XVF file.tar/usr/
3.. tar.gz and. tgz
Compression: TAR-ZCVF file.tar.gz dir
Decompression: TAR-ZXVF file.tar.gz
TAR-ZXVF file.tar.gz/usr/
4.. tar.bz2
Compression: TAR-JCVF file.tar.bz2 dir
Decompression: TAR-JXCVF file.tar.bz2
TAR-JXCVF file.tar.bz2/usr/
5.. BZ and. bz2
Compression: Bzip2-z dir
Decompression: bzip2-d file.bz2
BUNZIP2 file.bz2
6.. z
Compression: Compress dir
Decompression: uncompress file.z
7.. tar. Z
Compression: Tar zcvf file.tar.z dir
Decompression: Tar zxvf file.tar.z
8.. rar
Compression: rar a file.rar dir
Decompression: rar x File.rar
Tar command parameter options:
-C Create a new archive file
-R append file to end of archive file
-X to extract files from an archive file
This can be remembered, the creation of a new file is C, appended to the original file with R, extracted from the file with X
-O unpack the file to standard output
-V Process Output related information
-F to normal file operation---seems to always use F, otherwise, may not show
-Z Call gzip to compress the archive, and invoke gzip to complete the decompression when associated with-X
-Z Call compress to compress the archive, call compress to complete the decompression with the-X union
-T: View the files inside the Tarfile!
In particular, in the release of the parameters, c/x/t can only exist one! Cannot exist at the same time!
-P: Use original file properties (attributes are not changed according to user)
-P: You can use absolute path to compress!
-N: Newer than next date (YYYY/MM/DD) will be packaged in the new file!
--exclude file: In the process of compression, do not package file!
Ubuntu file compression and decompression