# # # #1. File Archive # # #
1.
File archiving, which is to turn multiple files into an archive file
2.
Tar C # #创建
F # #指定归档文件名称
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/9D/46/wKiom1l9RcbADrDuAABzEKwQ0AU520.png "title=" Screenshot from 2017-07-29 10-37-39.png "alt=" Wkiom1l9rcbadrduaabzekwq0au520.png "/>
t # #显示归档文件中的内容
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9D/46/wKiom1l9RijRWIdZAAFuqytvnpg319.png "title=" Screenshot from 2017-07-29 10-40-44.png "alt=" Wkiom1l9rijrwidzaafuqytvnpg319.png "/>
R # #向归档文件中添加文件
--get # #取出单个文件
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/9D/46/wKiom1l9R_Xw4JwfAAAhMu0fc6g454.png "title=" Screenshot from 2017-07-29 10-43-24.png "alt=" Wkiom1l9r_xw4jwfaaahmu0fc6g454.png "/>
--delete # #删除单个文件
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/9D/46/wKioL1l9R_aRS4geAABWwGCcl2U202.png "title=" Screenshot from 2017-07-29 10-44-13.png "alt=" Wkiol1l9r_ars4geaabwwgccl2u202.png "/>
X # #取出归档文件中的所有内容
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9D/46/wKiom1l9SHPSZ6gVAAAePFsNSM4041.png "title=" Screenshot from 2017-07-29 10-48-56.png "alt=" Wkiom1l9shpsz6gvaaaepfsnsm4041.png "/>
-C # #指定解档目录
-Z # #gz格式压缩
-J # #bz2格式压缩
-J # #xz格式压缩
# # # #2. Compression # # #
Gz
Gzip Etc.tar # #压缩成gz格式
Gunzip etc.tar.gz # #解压gz格式压缩包
Tar zcf etc.tar.gz/etc # #把文件归档为tar并压缩成gz
Tar zxf etc.tar.gz # #解压并解档gz格式压缩包
bz2
bzip2 Etc.tar # #压缩成bz2格式
BUNZIP2 etc.tar.bz2 # #解压bz2格式压缩包
Tar jcf etc.tar.bz2/etc # #把文件归档为tar并压缩成bz2
Tar jxf etc.tar.bz2 # #解压并解档bz2格式压缩包
Xz
XZ Etc.tar # #压缩成xz格式
Unxz ETC.TAR.XZ # #解压xz格式压缩包
Tar Jcf etc.tar.xz/etc # #把文件归档为tar并压缩成zx
Tar jxf etc.tar.xz # #解压并解档xz格式压缩包
Zip
Zip-r Etc.tar.zip Etc.tar # #压缩成zip格式
Unzip Etc.tar.zip # #解压zip格式压缩包
# # # #3. File transfer in the system # # #
SCP file [email protected]:/dir # #上传
SCP [email Protected]:/dir/file/dir # #下载
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/9D/46/wKioL1l9SPHgUke8AADoU57CaIY224.png "style=" float : none; "title=" screenshot from 2017-07-29 11-03-16.png "alt=" Wkiol1l9sphguke8aadou57caiy224.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9D/46/wKiom1l9SPHRuuL4AABnToYVG6Q770.png "style=" float : none; "title=" screenshot from 2017-07-29 11-15-22.png "alt=" Wkiom1l9sphruul4aabntoyvg6q770.png "/>
rsync [parameter] file [email protected]:/dir
Rsync-r # #同步目录
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/9D/46/wKioL1l9SUGBjPRvAAB0K1K_NDU578.png "title=" Screenshot from 2017-07-29 11-19-32.png "alt=" Wkiol1l9sugbjprvaab0k1k_ndu578.png "/>
-L # #不忽略链接
-P # #不忽略文件权限
-T # #不忽文件时间戳
-G # #不忽文件所有组
-O # #不忽文件所有人
-D # #不忽略设备文件
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9D/46/wKiom1l9SWWw-3EQAABjjcNY_Ik762.png "title=" Screenshot from 2017-07-29 11-26-29.png "alt=" Wkiom1l9swww-3eqaabjjcny_ik762.png "/>
This article is from the "13122425" blog, please be sure to keep this source http://13132425.blog.51cto.com/13122425/1952064
Linux Cloud Automation Operations Basics 12 (file transfer between different systems)