Linux Rookie Learning Path >>8

Source: Internet
Author: User

File transfer between different systems *******
# # 1 # # File archive
File archiving is to turn multiple files into an archive file
Setting method: Tar parameter
c//creation, create
F//Specify file Archive file name
t//Show archived file contents, List
R//Add a file to the specified archive file, append
--get//Remove a single file
--delete//delete individual files
X//Remove all content from the archive. Extract|ge
-c//Specify the directory of files, directory
-Z//gz format compression, gzip
-J//bz format compression, bzip2
-J//xz format compression, XZ


Example 1: Create an archive file and specify the archive file name File.tar


650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/88/66/wKiom1f1DjnzjuOoAACBb9GrRrQ655.png-wh_500x0-wm_3 -wmp_4-s_653247332.png "title=" capture. PNG "alt=" Wkiom1f1djnzjuooaacbb9grrrq655.png-wh_50 "/>

Example 2. Displaying the contents of an archive file File.tar

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/88/63/wKioL1f1DmGjm438AAAxytIFODw752.png-wh_500x0-wm_3 -wmp_4-s_4131649362.png "title=" capture. PNG "alt=" Wkiol1f1dmgjm438aaaxytifodw752.png-wh_50 "/>

Example 3. Adding a hello file to an archive file File.tar

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/88/66/wKiom1f1Dx2h9CTZAABI_vs-Gbw809.png-wh_500x0-wm_3 -wmp_4-s_605305985.png "title=" capture. PNG "alt=" Wkiom1f1dx2h9ctzaabi_vs-gbw809.png-wh_50 "/>

Example 4: Take out the archive file Hello in File.tar file

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/88/66/wKiom1f1DzmhrMRUAABDOCVtwrs457.png-wh_500x0-wm_3 -wmp_4-s_26864551.png "title=" capture. PNG "alt=" Wkiom1f1dzmhrmruaabdocvtwrs457.png-wh_50 "/>

Example 5: Delete the hello file in the archive file File.tar

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/88/63/wKioL1f1D2bzx7M5AAAvr2_KkPM693.png-wh_500x0-wm_3 -wmp_4-s_2937648039.png "title=" capture. PNG "alt=" Wkiol1f1d2bzx7m5aaavr2_kkpm693.png-wh_50 "/>

Example 6: File.tar file and specify the directory of the solution to Westos

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/88/66/wKiom1f1D7WjHnFUAAAxhbzVUMQ589.png-wh_500x0-wm_3 -wmp_4-s_412240030.png "title=" capture. PNG "alt=" Wkiom1f1d7wjhnfuaaaxhbzvumq589.png-wh_50 "/>


# # 2 # # compression

Gz
compressed into GZ format gzip ***.tar

Unzip gunzip ***.tar.gz

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/88/62/wKioL1f1C6uwoVPQAAB9UVzW1XQ382.png-wh_500x0-wm_3 -wmp_4-s_2635157464.png "title=" capture. PNG "alt=" Wkiol1f1c6uwovpqaab9uvzw1xq382.png-wh_50 "/>

Direct Package Compression tar zcf ***.tar.gz filename
Unzip and unzip the file tar zxf ***.tar.gz

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/88/66/wKiom1f1DCbhfdhYAACYH9MY60U500.png-wh_500x0-wm_3 -wmp_4-s_3658913318.png "title=" capture. PNG "alt=" Wkiom1f1dcbhfdhyaacyh9my60u500.png-wh_50 "/>

bz2
compressed into bz2 format bzip2 **.tar
Unzip bunzip2 ***.tar.bz2

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/88/62/wKioL1f1DE2QwucNAACQOjI2LC0253.png-wh_500x0-wm_3 -wmp_4-s_1266171402.png "title=" capture. PNG "alt=" Wkiol1f1de2qwucnaacqoji2lc0253.png-wh_50 "/>

Direct Package Compression tar jcf ***.tar.bz2 filename
Unzip and unzip the file tar jxf ***.tar.bz2

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/88/62/wKioL1f1DHXhepLMAAB9Z9NeOp8586.png-wh_500x0-wm_3 -wmp_4-s_2733180246.png "title=" capture. PNG "alt=" Wkiol1f1dhxheplmaab9z9neop8586.png-wh_50 "/>

Xz
compressed into XZ format XZ ***.tar
Unzip Unxz ***.tar.xz

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/88/66/wKiom1f1DJ7AlZzUAAC08eMQjys742.png-wh_500x0-wm_3 -wmp_4-s_2283911594.png "title=" capture. PNG "alt=" Wkiom1f1dj7alzzuaac08emqjys742.png-wh_50 "/>

Direct Package Compression tar Jcf ***.tar.xz filename
Unzip and unzip the file tar jxf ***.tar.xz

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/88/63/wKioL1f1DMqD-wR8AAC2aOIER-A524.png-wh_500x0-wm_3 -wmp_4-s_92776362.png "title=" capture. PNG "alt=" Wkiol1f1dmqd-wr8aac2aoier-a524.png-wh_50 "/>

Zip
compressed into Zip format zip-r ***.tar.zip ***.tar
Unzip Unzip ***.tar.zip

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/88/63/wKioL1f1DVLi20JtAAC1AmZrjJk745.png-wh_500x0-wm_3 -wmp_4-s_4243937281.png "title=" capture. PNG "alt=" Wkiol1f1dvli20jtaac1amzrjjk745.png-wh_50 "/>



# # 3 # # File transfer in the system
Uploaded: Scpfile [email Protected]:/dir
Download: [Email protected]:/dir/file/dir
File synchronization: rsync [parameter] file [email protected]:/dir copy to the latter host
-r//sync directory
-L//Do not ignore links
-P//Do not ignore file permissions
-t//Do not ignore file timestamps
-g//Do not ignore all groups of files
-O//Do not ignore file owner
-d//Do not ignore block devices


Example: synchronizing directories without ignoring file permissions

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/88/66/wKiom1f1DaOxjIqwAAC0nfLULMU436.png-wh_500x0-wm_3 -wmp_4-s_2330850430.png "title=" capture. PNG "alt=" Wkiom1f1daoxjiqwaac0nflulmu436.png-wh_50 "/>

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/88/63/wKioL1f1DeOyE835AABrxzR6l6U055.png-wh_500x0-wm_3 -wmp_4-s_4029774805.png "title=" capture. PNG "alt=" Wkiol1f1deoye835aabrxzr6l6u055.png-wh_50 "/>



Linux Rookie Learning Path >>8

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.