How to use compress file commands in linux ?
本文源自 Chu-Siang Lai, @chusiang
之文章「GNU / Linux 各種壓縮與解壓縮指令」,在此備份作為個人筆記用途。#
Commands#
Format | Zip | Unzip |
---|---|---|
.zip | zip -r filename.zip ./path | unzip filename.zip |
.rar | rar a filename.rar ./path | rar e filename.rarunrar e filename.rarrar x filename.rar ./path |
.7z | 7z a filename.7z filename(for encrypto: -p ) | 7z x filename.7z |
.tar | tar cvf filename.tar ./path | tar xvf filename.tar |
.tar.xz | tar Jcvf filename.tar.xz ./path | tar Jxvf filename.tar.xz |
.gz | gzip filename | gunzip filename.gzgzip -d filename.gz |
.tar.gz | tar zcvf filename.tar.gz ./path | tar zxvf filename.tar.gz |
.tar.bz | - | tar jxvf filename.tar.bz |
.bz2 | bzip2 -z filename | bzip2 -d filename.bz2bunzip2 filename.bz2 |
.tar.bz2 | tar jcvf filename.tar.bz2 ./path | tar jxvf filename.tar.bz2 |
.xz | xz -z filename | xz -d filename.xz |
.z | compress filename | uncompress filename.Z |
.tar.Z | tar Zcvf filename.tar.Z ./path | tar Zxvf filename.tar.Z |
.tgz | tar zcvf filename.tgz filename | tar zxvf filename.tgz |
.tar.tgz | tar zcvf filename.tar.tgz filename | tar zxvf filename.tar.tgz |
.lha | lha -a filename.lha filename | lha -e filename.lha |
.zst | zst filename | zstd -d filename.zst |
.tar.zst | tar -I zst -cvf filename.tar.zst ./pathtar -I zst -cvf filename.tar.zst File1 File2 | tar -I zstd -xvf filename.tar.zst |
References#
- 《GNU / Linux 各種壓縮與解壓縮指令 - chusiang》http://note.drx.tw/2008/04/command.html