日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

linux 壓縮文件的命令總結(jié)

Linux壓縮文件的讀取
?*.Z;;;;compress 程序壓縮的檔案;
?*.bz2;;bzip2 程序壓縮的檔案;
?*.gz;;;gzip 程序壓縮的檔案;
?*.tar;;tar 程序打包的數(shù)據(jù),并沒有壓縮過;
?*.tar.gz; tar 程序打包的檔案,其中并且經(jīng)過 gzip 的壓縮!
?*.zip;;zip 程序壓縮文件
?*.rar;;rar 程序壓縮文件
Compress壓縮文件
[root@test /root]# cp /etc/man.config /root
[root@test /root]# compress man.config //壓縮man.config這個(gè)文件
[root@test /root]# compress -d man.config.Z解壓縮這個(gè)文件
[root@test /root]# uncompress man.config.Z解壓縮這個(gè)文件;//; //-d
當(dāng)你以 compress 壓縮之后,如果沒有下達(dá)其它的參數(shù),那么原本的檔案就會(huì)被后來的 *.Z 所取代!
Gzip壓縮文件和zcat
[root@test /root]# gzip [-d#] filename壓縮與解壓縮 <==
[root@test /root]# zcat filename.gz;讀取壓縮檔內(nèi)容
參數(shù)說明:;
-d; :解壓縮的參數(shù)!; ;<==
-r ;:遞歸處理,將指定目錄下的所有文件及子目錄一并處理
-#; :壓縮等級(jí),1 最不好,9 最好,6 是默認(rèn)值!
[root@test /root]# gzip man.config;會(huì)產(chǎn)生 man.config.gz 這個(gè)檔案; ;;//
[root@test /root]# zcat man.config.gz會(huì)讀取出 man.config 的內(nèi)容 //
[root@test /root]# gzip -d man.config.gz;
[root@test /root]# gunzip man.config.gz 解壓縮,產(chǎn)生 man.config 這個(gè)檔案
;
[root@test /root]# gzip -9 man.config以最大壓縮比壓縮 testing 這個(gè)檔案!;//
[root@test /root]# gzip -r filename.gz file1 file2 file3 /usr/work/school
//file1、file2、 file3、以及/usr/work/school目錄的內(nèi)容(假設(shè)這個(gè)目錄存在)壓縮起來,然后放入filename.bz2文件中
Bzip2壓縮文件和bzcat
[root@test /root]# bzip2 [-dz] filename壓縮解壓縮指令 <==
[root@test /root]# bzcat filename.bz2讀取壓縮文件內(nèi)容指令
參數(shù)說明:
-d; :解壓縮的意思!
-z; :壓縮的意思!
范例:
同樣的,我們以剛剛拷貝過來的 /root/man.config 這個(gè)檔案為例
[root@test /root]# bzip2 –z man.config
[root@test /root]# bzcat man.config.bz2
[root@test /root]# bzip2 –d man.config.bz2
[root@test /root]# bunzip2 man.config.bz2<==
[root@test /root]# bzip2 filename.bz2 file1 file2 file3 /usr/work/school ;
//file1、file2、 file3、以及/usr/work/school目錄的內(nèi)容(假設(shè)這個(gè)目錄存在)壓縮起來,然后放入filename.bz2文件中
Tar壓縮文件
[root@test /root]# tar [-zxcvfpP] filename參數(shù)說明:;
-z; :是否同時(shí)具有 gzip 的屬性?;
-x; :解開一個(gè)壓縮檔案的參數(shù)指令!;
-t; :查看 tarfile 里面的檔案!
-c; :建立一個(gè)壓縮檔案的參數(shù)指令;
-v; :壓縮的過程中顯示檔案!;
-f; :使用檔名,請(qǐng)留意,在 f 之后要立即接檔名喔!不要再加參數(shù)!
 例如使用『 tar -zcvfP tfile sfile』就是錯(cuò)誤的寫法,要寫成
 『 tar -zcvPf tfile sfile』才對(duì)喔!
-p; :使用原檔案的原來屬性(屬性不會(huì)依據(jù)使用者而變);
-P; :可以使用絕對(duì)路徑;
-N; :比后面接的日期(yyyy/mm/dd)還要新的才會(huì)被打包進(jìn)新建的檔案中!;
--exclude FILE:在壓縮的過程中,不要將 FILE 打包!;
范例:;
[root@test /root]# tar -cvf directory.tar directory;;
[root@test /root]# tar -N "yyyy/mm/dd" /path -zcvf target.tar.gz source;
;
//只將目錄整合打包成一個(gè)檔案;
[root@test /root]# tar -zcvf directory.tar.gz directory; 除了將目錄打包外,同時(shí)以 gzip 壓縮;
;
[root@test /root]# tar -zcvf filename.tar.gz; /home/test/*; 將 /home/test/ 這個(gè)目錄下的檔案全部打包并壓縮成為一個(gè) filename.tar.gz 的檔案
;

推薦閱讀