Linux的壓縮和解壓縮的方法總結(jié)
Linux的壓縮和解壓縮的方法總結(jié)
一 常用的壓縮格式
- .zip
- .gz
- .bz2
- .tar.gz
- .tar.bz2
二 .zip格式壓縮
1、語法
zip 壓縮文件名 源文件名
壓縮文件
zip -r 壓縮文件名 源目錄
壓縮目錄
unzip 壓縮文件
解壓縮.zip文件
2、說明
.zip的格式在windows和LInux是通用的。
3、實戰(zhàn)
root@localhost test]# ls abc cdf [root@localhost test]# zip abc.zip abc adding: abc (stored 0%) [root@localhost test]# mkdir dirtst [root@localhost test]# touch ./dirtst/ert [root@localhost test]# zip -r dirtst.zip dirtst adding: dirtst/ (stored 0%) adding: dirtst/ert (stored 0%) [root@localhost test]# ls abc abc.zip cdf dirtst dirtst.zip [root@localhost test]# rm -fr abc [root@localhost test]# ls abc.zip cdf dirtst dirtst.zip [root@localhost test]# unzip abc.zip Archive: abc.zip extracting: abc [root@localhost test]# ls abc abc.zip cdf dirtst dirtst.zip [root@localhost test]# rm -rf dirtst [root@localhost test]# unzip dirtst.zip Archive: dirtst.zip creating: dirtst/ extracting: dirtst/ert [root@localhost test]# ls abc abc.zip cdf dirtst dirtst.zip
以上就是Linux 壓縮和解壓縮的實例詳解,如有疑問請留言或者到本站社區(qū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
相關(guān)文章
Linux中BT5關(guān)于修改靜態(tài)IP和DNS方法
本篇文章給大家整理了關(guān)于Linux中BT5關(guān)于修改靜態(tài)IP和DNS的方法,有需要的朋友可以參考學(xué)習(xí)下。2018-02-02Linux查看系統(tǒng)文件打開數(shù)的方法小結(jié)
有許多情況下,我們需要查看一個進程當(dāng)前打開了哪些文件,反過來我們也希望知道某一個文件正在被哪些進程所讀寫,在Linux下有許多有用的工具可以幫我們完成這兩個工作,本文給大家介紹了Linux查看系統(tǒng)文件打開數(shù)的方法小結(jié),需要的朋友可以參考下2024-07-07使用VSCode的Remote-SSH連接Linux進行遠程開發(fā)
這篇文章主要介紹了使用VSCode的Remote-SSH連接Linux進行遠程開發(fā),文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-08-08linux如何mount掛載磁盤并設(shè)置開機自動mount的實現(xiàn)
這篇文章主要介紹了linux如何mount掛載磁盤并設(shè)置開機自動mount的實現(xiàn),文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-09-09