Compression and decompression commands in Linux

  
        

Compression: tar -cf new.tar data.txt

Decompression: tar -xf new.tar -C tmp/----> The premise is that tmp must exist first, so that it can be decompressed After the file is placed in the tmp directory

Compress: gzip data.txt (gzip can only compress the file and can not compress the directory, the compressed suffix .gz exists, the original file will be overwritten)

Unzip: gzip -d data.txt.gz

Compression: bzip2 data.txt (can only compress files, exist in .bz2)

Extract: bzip2 -d data .txt.bz2

Compression: xz data.txt (can only compress files, exist in .xz)

Unzip: xz -d data.txt.xz

Copyright © Windows knowledge All Rights Reserved