File transfer, archiving, and compression in Linux systems for operation and maintenance learning

Source: Internet
Author: User
Tags bz2 rsync

File transfer between different systems

1. File archiving

1.

File archiving, which is to turn multiple files into an archive file

2.

Tarc# #创建

F# #指定归档文件名称

T# #显示归档文件中的内容

R# #向归档文件中添加文件

--get# #取出单个文件

--delete# #删除单个文件

x# #取出归档文件中的所有内容

-C # #指定解档目录

-Z # #gz格式压缩

-j# #bz2格式压缩

-j# #xz格式压缩

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/9C/A0/wKioL1lzXvyQE187AABw_U_Ef9I972.png "style=" float : none; "title=" screenshot from 2017-07-22 14-43-57.png "alt=" Wkiol1lzxvyqe187aabw_u_ef9i972.png "/>

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/9C/A0/wKiom1lzXv2w0ajzAAG3n4VT7HQ866.png "style=" float : none; "title=" screenshot from 2017-07-22 14-56-19.png "alt=" Wkiom1lzxv2w0ajzaag3n4vt7hq866.png "/>

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格式压缩包

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/9C/A0/wKioL1lzX6PwAuLiAABtEojPOnM323.png "title=" Screenshot from 2017-07-22 15-19-29.png "alt=" Wkiol1lzx6pwauliaabteojponm323.png "/>

bz2

bzip2 Etc.tar# #压缩成bz2格式

BUNZIP2 etc.tar.bz2# #解压bz2格式压缩包

Tar jcf etc.tar.bz2/etc# #把文件归档为tar并压缩成bz2

Tar jxf etc.tar.bz2# #解压并解档bz2格式压缩包

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9C/A0/wKiom1lzX7CDictHAABxtWR5FOw944.png "title=" Screenshot from 2017-07-22 15-21-32.png "alt=" Wkiom1lzx7cdicthaabxtwr5fow944.png "/>

Xz

XZ Etc.tar # #压缩成xz格式

Unxz etc.tar.xz# #解压xz格式压缩包

Tar Jcf etc.tar.xz/etc# #把文件归档为tar并压缩成zx

Tar jxf etc.tar.xz# #解压并解档xz格式压缩包

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/9C/A0/wKioL1lzX7qDToPcAABn8468vGw731.png "title=" Screenshot from 2017-07-22 15-23-10.png "alt=" Wkiol1lzx7qdtopcaabn8468vgw731.png "/>

Zip

Zip-r etc.tar.zip Etc.tar# #压缩成zip格式

Unzip Etc.tar.zip# #解压zip格式压缩包

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/9C/A0/wKiom1lzX8Tiy6h8AABSjMXj-hQ339.png "title=" Screenshot from 2017-07-22 15-24-32.png "alt=" Wkiom1lzx8tiy6h8aabsjmxj-hq339.png "/>

3. File transfer in the system

SCPfile [email protected]:/dir# #上传

SCP [email Protected]:/dir/file/dir# #下载


rsync [parameter]file[email protected]:/dir

Rsync-R # #同步目录

-L # #不忽略链接

-P # #不忽略文件权限

-t # #不忽文件时间戳

-G # #不忽文件所有组

-o # #不忽文件所有人

-D # #不忽略设备文件

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/9C/9F/wKiom1lzXrzBfoojAABXMqhPhV8025.png "style=" float : none; "title=" screenshot from 2017-07-22 11-50-09.png "alt=" Wkiom1lzxrzbfoojaabxmqhphv8025.png "/>

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/9C/A0/wKioL1lzXryDBJ3PAAAo1Adk04A663.png "style=" float : none; "title=" screenshot from 2017-07-22 13-54-07.png "alt=" Wkiol1lzxrydbj3paaao1adk04a663.png "/>

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/9C/9F/wKiom1lzXr2Qr5CiAAA9mwO8OuE381.png "style=" float : none; "title=" screenshot from 2017-07-22 13-56-33.png "alt=" Wkiom1lzxr2qr5ciaaa9mwo8oue381.png "/>

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/9C/A0/wKiom1lzXr3Tn1SOAACdMz1dtIA702.png "style=" float : none; "title=" screenshot from 2017-07-22 14-16-30.png "alt=" Wkiom1lzxr3tn1soaacdmz1dtia702.png "/>

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/9C/A0/wKioL1lzXr7jGQM7AABrdQL_83U707.png "style=" float : none; "title=" screenshot from 2017-07-22 14-33-29.png "alt=" Wkiol1lzxr7jgqm7aabrdql_83u707.png "/>


File transfer, archiving, and compression in Linux systems for operation and maintenance learning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.