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

Linux常用命令: 压缩解压

2023-03-06 21:32 作者:石城城  | 我要投稿

放心~被指到的人一定能学会的~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 


tar

归档应用

一般使用的时候结合gzip和bzip的压缩使用

zip

打包压缩zip文件

unip

解压zip压缩包

 

1. tar

Archiving utility.

归档应用

Often combined with a compression method, such as gzip or bzip.

一般使用的时候结合gzip和bzip的压缩使用

• Create a gzipped archive(创建一个gzip压缩包):

• Create a gzipped archive from a directory using relative paths(压缩指定目录内容):

• Extract a (compressed) archive into the current directory(解压):

• Extract an archive into a target directory(指定目录解压):

• Create a compressed archive, using archive suffix to determine the compression program(创建压缩文件通过后缀xz决定压缩方法):

• List the contents of a tar file(显示包内容):

• Extract files matching a pattern(部分提取匹配文件):

2. zip/unzip

zip

Package and compress (archive) files into zip file.

打包压缩zip文件

• E[x]clude unwanted files from being added to the compressed archive(打包压缩式去除不需要文件):

zip -r {{compressed.zip}} {{path/to/dir}} -x {{path/to/exclude}}

• Package and compress multiple directories and files(打包压缩多个目录文件):

• Create an encrypted archive (user will be prompted for a password)(打包压缩加密包):

• Add files to an existing zip file(向zip包中添加文件):

• Delete files from an existing zip file(从zip包中删除文件):

• Archive a directory and its contents to a multi-part [s]plit zip file (e.g. 3GB parts)(按照大小分割压缩包):

unip

Extract compressed files in a ZIP archive.

解压zip压缩包

• Extract zip file(s) (for multiple files, separate file paths by spaces)(当前目录解压):

• Extract zip files(s) to given path(指定目录解压):

• List the contents of a zip file without extracting(查看压缩包内容):

• Extract a zip file created in windows, containing files with non-ascii (chinese) filenames(解压中文名压缩包,中文不乱码):

 

自学笔记~

如果有错~

期待大佬指出~

感谢帮助提升~ 


Linux常用命令: 压缩解压的评论 (共 条)

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