Compress, decompress, archive

Compression commands: zip, gzip, bzip2, xz


gzip: delete the source file after compression, automatically add suffix, cannot compress directory, soft link, suffix .gz
gunzip: delete the source file after decompression
zcat:
  gzip file...automatically create a file with the same name with the suffix name without decompression, delete the source file and
  gzip -c file > file.gzuse the standard output to use File redirection creates a compressed file, thereby retaining the source file. It seems that the only way to compress a single file is
  gzip -d file...to decompress and delete the source file. If there is a file with the same name, the interactive prompt asks to unzip
  gunzip file...and delete the source file.
  zcat file...View the file content below, the file file needs to be a compressed file with the suffix .gz, and the connection displays multiple files

bzip2: delete the source file after compression, automatically add suffix, cannot compress directories, soft links, suffix .bz2
bunzip: delete the source file after decompression
bzcat:
  bzip2 flie...automatically create a file with the same name with the suffix name without decompression, delete the source file and
  bzip2 -k file...keep the source file for Compress
  bzip2 -d file...and decompress, delete the source file, if there is a file with the same name that fails to decompress, the source file remains
  bunzip2 file...uncompressed, delete the source file, if there is a file with the same name that fails to decompress, the source file remains unchanged
  bzcat file.... .bz2 compressed file, the connection shows multiple files

xz: delete the source file after compression, automatically add suffix, cannot compress directories, soft links, suffix .xz
unxz: delete the source file after
decompression If there is a file with the same name that fails to decompress, the source file will not be decompressed, and the source file will be deleted. If there is a file with the same name that fails to be decompressed, the source file will remain unchanged and view the file content without decompression. The file file must be a compressed file with the suffix .xz. Connection showing multiple files
  xz file...
  xz -d file...
  unxz file...
  xzcat file...

zip: keep the source file after archiving and compression, suffix .zip
unzip: keep the source file after decompression, it seems that you can
  zip New_file file...automatically add a suffix to New_file without the suffix, file can be mixed with directory and file, if there is a directory, just the compressed directory itself
  zip -r New_file file...will automatically add a suffix to New_file, The file can be mixed with the directory and the file. If there is a directory
  unzip filedecompression, if there is an interactive prompt for a file with the same name, the soft link of the file becomes an entity file after decompression. The content of the file is the same as that of the previous link file. The content of the file in the link directory becomes the physical file. The content of the file in the link is the same as that of the previous link.
  zcat file...View the content of the file without decompressing. The file file needs to be a compressed file with the suffix .zip, and the connection displays multiple files.

Archive, compress: tar


tar [option] -f New_file file...The suffix needs to be added manually, -f must be next to the file name, and the location cannot be exchanged with other options. The archive, decompression, and decompression symbolic links are not invalid
  -cto create. You need to manually add the suffix .tar
  -xto expand, and decompression does not delete the source file
  -t. The filenames contained in the compressed file are
  -zarchived and compressed. For gzip compression, the suffix .gz needs to be added manually, and the source file is not deleted. The decompression can only be compressed by tar
  -jarchive. For bz2 compression, the suffix .bz2 needs to be added manually, and the source file is not deleted. Decompression can only use tar
  -Jarchive compression, xz compression, you need to manually add the suffix .xz, do not delete the source file, decompression can only use tar

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324972959&siteId=291194637