Linux file operations of compression, decompression

File Compression command

tar -zcvf filename.tar.gz filename

tar -jcvf filename.tar.bz2 filename

File decompression command

tar -zxcf filename.tar.gz

tar -jxvf filename.tar.bz2

Extract the files to a specific directory

tar -zxcf filename.tar.gz -C dirname

tar -jxvf filename.tar.bz2 -C dirname

Guess you like

Origin www.cnblogs.com/no-end-to-learning/p/12032632.html