TLCL學(xué)習(xí)筆記|第十九章|歸檔和備份
(認(rèn)知有限,如有不妥,還請告知,歡迎討論)
gzip
執(zhí)行?gzip <file> ,壓縮文件
執(zhí)行?gunzip <file.gz>?,解壓文件

執(zhí)行?gunzip -c foo.txt.gz | less , 可以只瀏覽gz文件內(nèi)的內(nèi)容
bzip2
與 gzip 程序相似,但是使用了不同的壓縮算法, 舍棄了壓縮速度,而實現(xiàn)了更高的壓縮級別。
執(zhí)行 bzip2 <file> ,壓縮文件
執(zhí)行?bunzip2?gunzip <file.bz2>?,解壓文件

tar
擴展名為 .tar 或者 .tgz 的文件,它們各自表示“普通” 的 tar 包和被 gzip 程序壓縮過的 tar 包。
eg.?執(zhí)行tar cf playground.tar playground, 對文件夾playground進行壓縮

執(zhí)行tar tf playground.tar,列出壓縮文件內(nèi)容

執(zhí)行tar tvf playground.tar,列出壓縮文件詳細(xì)內(nèi)容

將在上一層目錄的playground.tar文件,解壓到當(dāng)前目錄下,可執(zhí)行
tar xf ../playground.tar

結(jié)合管道使用生成.tar.gzip和.tar.bzip2文件

zip
eg.執(zhí)行zip -r playground.zip playground,對文件夾playground進行壓縮。
(在創(chuàng)建 zip 版本的文件包時,zip 命令通常會顯示一系列的信息)

執(zhí)行unzip playground.zip, 解壓文件

rsync
rsync [options]?<source>?<destination>
source 和 destination 兩者之一必須是本地文件。rsync 不支持遠(yuǎn)端到遠(yuǎn)端的復(fù)制
=END=
=reference=
[1]billie66.github.io/TLCL/book/chap19.html