0
Thanks

A few words of thanks would be greatly appreciated.

Compression and decompression with the Linux Shell





Here are some commands to compress and decompress files and folder on Linux:
  • gunzip file.gz: Uncompress a file or folder (.gz or .tgz)
  • unzip file.zip: Unzip a file or folder in zip format.
  • uncompress file.Z:Extracts a file or folder in .Z
  • zip arch.zip files: Compress a file or folder in zip format.
  • gzip file: Compress a file or folder in .gz
  • compress file: Compress a file or folder in .Z
  • tar -cf arch.tar rep : Create an archive of the "dir" directory
  • tar -tf arch.tar: Examine the contents of the arch.tar archive
  • tar -xf arch.tar: Extract the arch.tar archive
  • tar -xf arch.tar -C /home:Extracts a file or folder in /home (for recent versions of tar)
  • cd /home; tar -xf: archive.tar:Extracts a file or directory in /home (all version)
  • tar -xpf archive.tar:Extracts a file or folder while keeping as much as possible the rights (including flags set-UID)
  • tar -xzf file.tgz:Extracts a file or file format .tgz or .gz (recent versions of tar)
  • gunzip file.tgz | tar -xf-:Extracts a file or folder in .tgz or .gz (all versions)
  • tar -xjf file.tar.bz2:Extracts a file or folder in .tar.bz2 under GNU
  • bunzip file.bz2 | tar -xf -:Extracts a file or folder in .tar.bz2 (all version)



Related FAQ:
0
Thanks

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jeff Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.

Original article published by . Translated by jak58. Latest update on by jak58.

This document, titled "Compression and decompression with the Linux Shell," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (https://ccm.net/).

0 Comments