1. File archiving
Defined:
File archiving, which is to turn multiple files into an archive file
|
2.
Tar C # #创建
-j XZ Format Compression |
F Specify the archive file name |
T Display the contents of the archive file |
R to add a file to an archive file |
--get Remove a single file |
--delete Delete a single file |
x Remove all content from the archive file |
- C Specify the directory of the solution file |
- Z GZ Format Compression |
-j bz2 Format Compression |
C Create |
F Specify the archive file name |
650) this.width=650; "Src=" Https://s1.51cto.com/oss/201710/24/2cfc687f6cad6dad22bc312651bd0be6.png-wh_500x0-wm_3 -wmp_4-s_3582119782.png "style=" Float:none; "title=" screenshot from 2017-10-21 22-43-09.png "alt=" 2cfc687f6cad6dad22bc312651bd0be6.png-wh_ "/>
--delete Delete a single file |
650) this.width=650; "Src=" Https://s3.51cto.com/oss/201710/24/de4d0b48d465b17f7be2be60a54275b5.png-wh_500x0-wm_3 -wmp_4-s_3054349678.png "style=" Float:none; "title=" screenshot from 2017-10-21 23-19-52.png "alt=" De4d0b48d465b17f7be2be60a54275b5.png-wh_ "/>
T Display the contents of the archive file |
R to add a file to an archive file |
650) this.width=650; "Src=" Https://s5.51cto.com/oss/201710/24/86a0b76f4b07cf93041c73efd336cb59.png-wh_500x0-wm_3 -wmp_4-s_1976589882.png "style=" Float:none; "title=" screenshot from 2017-10-21 23-14-32.png "alt=" 86a0b76f4b07cf93041c73efd336cb59.png-wh_ "/>
x Remove all content from the archive file |
650) this.width=650; "Src=" Https://s4.51cto.com/oss/201710/24/b5431500d6e56cfa0c42ea8021376db3.png-wh_500x0-wm_3 -wmp_4-s_1261435942.png "title=" screenshot from 2017-10-21 23-33-42.png "alt=" B5431500d6e56cfa0c42ea8021376db3.png-wh_ "/>
--get Remove a single file |
650) this.width=650; "Src=" Https://s5.51cto.com/oss/201710/24/93108b38196c48389961bdf8adede45a.png-wh_500x0-wm_3 -wmp_4-s_2082598689.png "style=" Float:none; "title=" screenshot from 2017-10-21 23-36-53.png "alt=" 93108b38196c48389961bdf8adede45a.png-wh_ "/>
650) this.width=650; "Src=" Https://s3.51cto.com/oss/201710/24/71f2a20f6be7f7417fab42ed3caa3fdc.png-wh_500x0-wm_3 -wmp_4-s_797156889.png "title=" screenshot from 2017-10-22 00-09-42.png "alt=" 71f2a20f6be7f7417fab42ed3caa3fdc.png-wh_ "/>
- C Specify the directory of the solution file |
650) this.width=650; "Src=" Https://s3.51cto.com/oss/201710/24/a697c906a70913831bb2afdc7316bfd7.png-wh_500x0-wm_3 -wmp_4-s_3731907778.png "title=" screenshot from 2017-10-22 00-16-17.png "alt=" A697c906a70913831bb2afdc7316bfd7.png-wh_ "/>
-j bz2 Format Compression |
- Z GZ Format Compression |
650) this.width=650; "Src=" Https://s2.51cto.com/oss/201710/24/98322a61e0e50239e57aafc337eed3e1.png-wh_500x0-wm_3 -wmp_4-s_2664761113.png "title=" screenshot from 2017-10-23 18-55-03.png "alt=" 98322a61e0e50239e57aafc337eed3e1.png-wh_ "/>
650) this.width=650; "Src=" Https://s3.51cto.com/oss/201710/24/5788d9e30b3729f1a551d91cccd6efbb.png-wh_500x0-wm_3 -wmp_4-s_2466436280.png "title=" screenshot from 2017-10-23 19-29-02.png "alt=" 5788d9e30b3729f1a551d91cccd6efbb.png-wh_ "/>
Second, 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://s1.51cto.com/oss/201710/24/ed833a5cefa4b48efbb9fc40d09e2cef.png-wh_500x0-wm_3 -wmp_4-s_1179814067.png "style=" Float:none; "title=" screenshot from 2017-10-21 23-55-52.png "alt=" Ed833a5cefa4b48efbb9fc40d09e2cef.png-wh_ "/>
650) this.width=650; "Src=" Https://s3.51cto.com/oss/201710/24/d4596fdacbb27b2c18294a3448b1832a.png-wh_500x0-wm_3 -wmp_4-s_3556675284.png "style=" Float:none; "title=" screenshot from 2017-10-22 00-04-26.png "alt=" D4596fdacbb27b2c18294a3448b1832a.png-wh_ "/>
650) this.width=650; "Src=" Https://s1.51cto.com/oss/201710/24/b94833b7572183b90d618ca3c4875d91.png-wh_500x0-wm_3 -wmp_4-s_4026384405.png "style=" Float:none; "title=" screenshot from 2017-10-22 00-06-28.png "alt=" B94833b7572183b90d618ca3c4875d91.png-wh_ "/>
The TAR command simply archives multiple files as a file, and the shortcuts for some applications are automatically deleted during the archive, but the GIZP command compresses the files as follows.
650) this.width=650; "Src=" Https://s4.51cto.com/oss/201710/24/ad863cc6bde3dc5333a3ae1269193d17.png-wh_500x0-wm_3 -wmp_4-s_524698579.png "title=" screenshot from 2017-10-22 00-13-35.png "alt=" Ad863cc6bde3dc5333a3ae1269193d17.png-wh_ "/>
2.bz2
bzip2 etc.tar< /span> compressed into bz2 format |
Decompression bz2 format compression package |
tar jcf etc.tar.bz2/etc extract and unpack bz2 format compressed package |
650) this.width=650; "Src=" Https://s1.51cto.com/oss/201710/24/7009c0e898f6987e1277ced3cb2f1583.png-wh_500x0-wm_3 -wmp_4-s_2144028672.png "title=" screenshot from 2017-10-22 00-18-21.png "alt=" 7009c0e898f6987e1277ced3cb2f1583.png-wh_ "/>
3.XZ
XZ Etc.tar # #压缩成xz格式
Unxz etc.tar.xz # #解压xz格式压缩包
tar Jcf etc.tar.xz/etc # #把文件归档为tar并压缩成zx
tar jxf etc.tar.xz # #解压并解档xz格式压缩包
XZ Etc.tar compress into XZ format |
650) this.width=650; "Src=" Https://s1.51cto.com/oss/201710/24/4f78a16e34f23dd2e0873a76575c3927.png-wh_500x0-wm_3 -wmp_4-s_1311142456.png "title=" screenshot from 2017-10-23 18-59-20.png "alt=" 4f78a16e34f23dd2e0873a76575c3927.png-wh_ "/>
Unxz etc.tar.xz unzip the XZ format Compression pack |
650) this.width=650; "Src=" Https://s4.51cto.com/oss/201710/24/8cd2759fa0e4f5a08a89e80e587078ef.png-wh_500x0-wm_3 -wmp_4-s_3213584313.png "title=" screenshot from 2017-10-23 18-59-55.png "alt=" 8cd2759fa0e4f5a08a89e80e587078ef.png-wh_ "/>
tar Jcf etc.tar.xz/etc archive files as tar and compress into ZX |
650) this.width=650; "Src=" Https://s1.51cto.com/oss/201710/24/918d7c1459464aa57b88de2e142d0139.png-wh_500x0-wm_3 -wmp_4-s_2689140831.png "title=" screenshot from 2017-10-23 19-28-16.png "alt=" 918d7c1459464aa57b88de2e142d0139.png-wh_ "/>
4. zip
zip-r etc.tar.zip Etc.tar # #压缩成zip格式 |
Unzip Etc.tar.zip # #解压zip格式压缩包 |
650) this.width=650; "Src=" Https://s1.51cto.com/oss/201710/24/d58acdc9c5f87c71c2fcd31934df817b.png-wh_500x0-wm_3 -wmp_4-s_2399707006.png "title=" screenshot from 2017-10-23 19-32-22.png "alt=" D58acdc9c5f87c71c2fcd31934df817b.png-wh_ "/>
650) this.width=650; "Src=" Https://s3.51cto.com/oss/201710/24/ef9838b7df7f2932824624387e7524d0.png-wh_500x0-wm_3 -wmp_4-s_4250975829.png "title=" screenshot from 2017-10-23 19-34-22.png "alt=" Ef9838b7df7f2932824624387e7524d0.png-wh_ "/>
650) this.width=650; "Src=" Https://s1.51cto.com/oss/201710/24/d85851230ad16f189a15ce4a1cc95974.png-wh_500x0-wm_3 -wmp_4-s_3041554665.png "title=" screenshot from 2017-10-23 19-53-31.png "alt=" D85851230ad16f189a15ce4a1cc95974.png-wh_ "/>
3. File transfer in the system
SCP file [Email Protected]:/dir Upload |
SCP [Email protected]:/dir/file/dir Download |
650) this.width=650; "Src=" Https://s1.51cto.com/oss/201710/24/7af96a9aca70c318f487b7eb370b4e80.png-wh_500x0-wm_3 -wmp_4-s_2153354546.png "title=" screenshot from 2017-10-21 22-29-55.png "alt=" 7af96a9aca70c318f487b7eb370b4e80.png-wh_ "/>
650) this.width=650; "Src=" Https://s1.51cto.com/oss/201710/24/01d86f4228b85e7f572962818c861eb1.png-wh_500x0-wm_3 -wmp_4-s_3935946332.png "title=" screenshot from 2017-10-21 23-06-42.png "alt=" 01d86f4228b85e7f572962818c861eb1.png-wh_ "/>
rsync [parametric] file [Email Protected]:/dir
The rsync command is a remote Data Synchronization command that allows fast synchronization of files between multiple hosts via Lan/wan. Rsync uses the so-called "rsync algorithm" to enable files between local and remote hosts to be synchronized, rather than being delivered every time, so it is fast.
rsync - R Synchronizing Directories
- L do not ignore links |
- P do not ignore file permissions |
- T file timestamp is not suddenly |
- G do not suddenly file all groups |
- o No, the file owner . |
- D do not ignore device files |
650) this.width=650; "Src=" Https://s3.51cto.com/oss/201710/24/fe2220ce7befc07cb42f59c32431bdc6.png-wh_500x0-wm_3 -wmp_4-s_3894809472.png "title=" screenshot from 2017-10-23 20-14-12.png "alt=" Fe2220ce7befc07cb42f59c32431bdc6.png-wh_ "/>
This article is from the "13345576" blog, please be sure to keep this source http://13355576.blog.51cto.com/13345576/1975837
Linux file archiving, compression and upload, download