Linux Compression command Cheatsheet

Last Updated On Sunday 19th Dec 2021

Zip

  • zip -r (directory) compressed file source file/source directory
  • unzip source file -d specifies the path

Gz

  • gzip source files
  • gzip -c source file> compressed file
  • gzip -r source directory compresses all sub-files in the source directory separately
  • gzip -d (decompressed) file
  • gunzip compressed file

Tar

  • -z Compress .tar to .tar.gz -j Compress .tar to .tar.bz2
  • -c pack -x unpack
  • -t View compressed files
  • -v display process
  • -f specifies the name of the compressed file
  • -C specifies the decompression path

7z

  • 7z x manager.7z.
  • a: add
  • x: extract
  • -r: recursive
  • -o: specific path
  • -t: type