Linux Compression command Cheatsheet

Last Updated On Sunday 19th Dec 2021


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


  • 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


  • -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 x manager.7z.
  • a: add
  • x: extract
  • -r: recursive
  • -o: specific path
  • -t: type