欢迎光临散文网 会员登陆 & 注册

TLCL学习笔记|第十九章|归档和备份

2022-04-20 23:32 作者:LogByMax  | 我要投稿

(认知有限,如有不妥,还请告知,欢迎讨论)


gzip

执行 gzip <file> ,压缩文件

执行 gunzip <file.gz> ,解压文件

执行 gunzip -c foo.txt.gz | less , 可以只浏览gz文件内的内容


bzip2

与 gzip 程序相似,但是使用了不同的压缩算法, 舍弃了压缩速度,而实现了更高的压缩级别。

执行 bzip2 <file> ,压缩文件

执行 bunzip2 gunzip <file.bz2> ,解压文件


tar

扩展名为 .tar 或者 .tgz 的文件,它们各自表示“普通” 的 tar 包和被 gzip 程序压缩过的 tar 包。

eg. 执行tar cf playground.tar playground, 对文件夹playground进行压缩

执行tar tf playground.tar,列出压缩文件内容


执行tar tvf playground.tar,列出压缩文件详细内容

将在上一层目录的playground.tar文件,解压到当前目录下,可执行

tar xf ../playground.tar

结合管道使用生成.tar.gzip和.tar.bzip2文件


zip

eg.执行zip -r playground.zip playground,对文件夹playground进行压缩。

(在创建 zip 版本的文件包时,zip 命令通常会显示一系列的信息)

执行unzip playground.zip, 解压文件


rsync

rsync [options] <source> <destination>

source 和 destination 两者之一必须是本地文件。rsync 不支持远端到远端的复制


=END=

=reference=

[1]billie66.github.io/TLCL/book/chap19.html

TLCL学习笔记|第十九章|归档和备份的评论 (共 条)

分享到微博请遵守国家法律