700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > java解压缩和shell_shell 文件的归档和压缩

java解压缩和shell_shell 文件的归档和压缩

时间:2021-10-02 20:26:00

相关推荐

java解压缩和shell_shell   文件的归档和压缩

tar归档

-c 创建文件

-f 指定文件

-v 冗余信息

打包到归档文件

tar -cf output.tar file1 file2 file3 folder1 ..

列出归档文件的内容

tar -tf output.tar

tar -tvf out.tar

向已归档的文件中添加另一个文件

$ tar -rvf original.tar new_file

从归档文件中提取文件或文件夹

tar -xf out.tar

将文件抽取到指定目录下,目录必须先要存在

tar -xf archive.tar -C /path/to/extraction_directory

归档之后再压缩

gz bz2

压缩和解压缩

gzip,gunzip可以用于压缩与解压缩

压缩的方式有3种 。 lzma 。 gzip, bzip2,zip

zip命令

zip对文档进行压缩

zip file.zip file

对文件夹进行递归操作

zip -r archive.zip folder1 folder2

在压缩文件中添加新的文件

zip file.zip -u newfile

在压缩文件中删除文件

zip -d arc.zip file.txt

列出压缩文件中的内容

unzip -l archive.zip

要从文件中提取内容 unzip之后并不会删除之前的内容

unzip file.zip

rsync同步备份

rsync -avz source destination

rsync -avz /users/apple/backup root@10.10.244.36:/data/tomcat/puhui-core-server-restful-1.0/logs

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。