web123456

Linux compression decompression command

Compression and decompression command

tar (commonly used)

Original meaning in English:
 The directory where the command is located: /bin/tar
 Execution permissions: All users
 Function description: Packaging directory
 Syntax: $tar option [-zcf][Compressed file name][Directory]
		 -c Packaging
		 -x Unpacking
		 -v Show details
		 -f Specify file name
		 -z compress or decompress through gzip, and finally suffix with . (fast compression speed)
		 -j compress or decompress through bzip2, and finally suffixed with .tar.br2.  The size after compression is less than.
 Note: (The file format after compressing the file is .)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
## -z compress with gzip
$ tar -zcf  /tmp/linuxtest/demo	
## -j compress with bzip2
$ tar -jcf .br2 /tmp/linuxtest/demo	
  • 1
  • 2
  • 3
  • 4

gzip

Original meaning in English: GNU zip
 The directory where the command is located: /bin/gzip
 Execution permissions: All users
 Function description: Compressed file (no source file reserved)
 Syntax: $ gzip [file] (the file format is .gz after compressing the file)
  • 1
  • 2
  • 3
  • 4
  • 5

gunzip

Original meaning in English: GNU uzip
 The directory where the command is located: /bin/gunzip
 Execution permissions: All users
 Function description: Unzip the compressed file of .gz (the source file is not retained)
 Syntax: $ gunzip [Compressed file]

 Or use $ gzip -d
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

zip

Original meaning in English:
 The command directory is: /usr/bin/zip
 Execution permissions: All users
 Function description: Compressed file or directory (source file will be retained)
 Syntax: $zip option [-r] [Compressed file name] [File or directory] (Compressed file format .zip)
			 -r Compressed directory
			 Compressed file without -r
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

unzip

Original meaning in English:
 The command directory is: /usr/bin/unzip
 Execution permissions: All users
 Function description: Unzip the compressed file of .zip (the source file will be retained)
 Syntax: $ unzip [compressed file]
  • 1
  • 2
  • 3
  • 4
  • 5

bzip2

Original meaning in English:
 The directory where the command is located: /user/bin/bzip2
 Execution permissions: All users
 Function description: Compressed file
 Syntax: $ bzip2 option [-k][file] (compressed file format .bz2)
		 -k Retain the source file after generating compressed files
 Example: $ bzip2 -k demo
	 $ tar -cjf .bz2 demo (generates a compressed package that is not falling to bz2)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

bunzip2

Original meaning in English:
 The command directory is located: /usr/bin/bunzip2
 Execution permissions: All users
 Function description: Unzip the compressed file of .bz2
 Syntax: $ bunzip2 option [-k][Compressed file]
		 -k Retain the source file after generating compressed files
 Example: $ bunzip2 -k demo.bz2
	 $ tar -xjf .bz2
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8