2013年1月11日 星期五

Linux各種解壓縮

.tar
Uncompress:
$ tar xvf directory.tar
Compress:
$ tar cvf directory.tar directory
.bz2
Uncompress:
$ bzip2 -d directory.bz2
Compress: 只能壓縮指定檔案,不能壓縮目錄
$ bzip2 -zk file1 file2 file3
.tar.bz2
Uncompress:
$ tar jxvf directory.tar.bz2
Compress:
$ tar jcvf directory.tar.bz2 directory
.bz
Uncompress:
$ bzip2 -d directory.bz
Compress:
未知
.tar.bz
Uncompress:
$ tar jxvf directory.tar.bz
Compress:
$ tar jcvf directory.tar.bz directory

.gz
Uncompress:
$ gzip -d directory.gz
Compress: 只能壓縮指定檔案,不能壓縮目錄
$ gzip file1 file2 file3
.tar.gz
Uncompress:
$ tar zxvf directory.tar.gz
Compress:
$ tar zcvf directory.tar.gz directory
.tgz
Uncompress:
$ tar zxvf directory.tgz
Compress:
$ tar zcvf directory.tgz directory
.tar.tgz
Uncompress:
$ tar zxvf directory.tar.tgz
Compress:
$ tar zcvf directory.tar.tgz directory
.Z
Install:
$ sudo apt-get install ncompress
Uncompress:
$ uncompress directory.Z
Compress: 只能壓縮指定檔案,不能壓縮目錄
$ compress file1 file2 file3
.tar.Z
Uncompress:
$ tar Zxvf directory.tar.Z
Compress:
$ tar Zcvf directory.tar.Z directory
.zip
Install:
$ sudo apt-get install zip
Uncompress:
$ unzip directory.zip
Compress:
$ zip -r directory.zip directory
.rar
Install:
$ sudo apt-get install rar
Uncompress:
$ rar e directory.rar
Compress:
$ rar a directory.rar directory
.lha
Install:
$ sudo apt-get install lha
Uncompress:
$ lha -e directory.lha
Compress:
$ lha -a directory.lha directory

沒有留言:

張貼留言