compression command: Compress gzip bzip2 zipCompress (the command is obsolete):
- compress-v xxx (-V: Show progress), after compression xxx files will disappear and be replaced with XXX.Z
- Compress-c-V xxx > xxx.z (-C: Source files are still retained after being compressed)
- Uncompress xxx.z (Uncompressed)
gzip:
- gzip xxx (compression xxx, generate xxx.gz,xxx disappears)
- Zcat xxx.gz (View the contents of the compressed file)
- Gzip-d xxx.gz (-D: extracting xxx.gz)
- gzip-c xxx > xxx.gz (compressed source file still exists)
bzip2:
- bzip2 xxx (compression xxx, generate xxx.bz2,xxx disappears)
- Bzcat xxx.bz2 (View the contents of the compressed file)
- Bzip2-d xxx.bz2 (-D: extracting xxx.bz2)
- bzip2-c xxx > xxx.bz2 (compressed source file still exists)
- LS-1H (View the size of the compressed file)
Zip:
- Zip xxx.zip xxx (compression xxx for xxx.zip)
- Unzip Xxx.zip (decompression xxx.zip)
Packaging Command (TAR): packaging itself does not have the compression function, the archive function, after the archive due to the extra pocket, the size will become larger, will not shrink
- Package: Tar cvf xxx.tar xxx (c:create;v--shows the progress of the archive; f--indicates the name after the archive)
- Note: The source file is retained after archiving, if you do not want to keep the source file, followed by the--remove-files parameter: tar cvf xxx.tar xxx--remove-files
- In the case of an unsolved document, you want to see what files are in the. tar package: Tar TVF Xxx.tar
- Solution (default file to current folder): Tar xvf Xxx.tar
- Solution to the specified directory, plus the large C parameter: Tar xvf xxx.tar-c aa/
- Package all files under the current directory: Tar cvf Xxx.tar *--remove-files
- Extract only some of the files in the Xxx.tar: First Use tar TVF Xxx.tar to see what files are in the tar package, and then use tar xvf xxx.tar partofxxx
- In the packaging process also want to compress, with gzip (plus z parameter) or bzip2 (plus the J parameter), also support to extract only some files, extract into the specified directory, can be combined with
- Use gzip, such as: Tar zcvf xx.tar.gz * (--remove-files) and unzip: Tar zxvf xx.tar.gz
- Use bzip2, such as: Tar JCVF xx.tar.bz2 * Unzip and unzip: Tar jxvf xx.tar.bz2
File and file system compression and packaging