当前位置: 移动技术网 > 科技>操作系统>Linux > [linux]在使用rsync时需要注意的小细节

[linux]在使用rsync时需要注意的小细节

2019年09月13日  | 移动技术网科技  | 我要评论

油缸防护罩,请客网,脱轨淑女

很简单:前一个目录末尾是目录的话,最后是否带/是有区别的。

具体看测试:

 1 # usr @ the-pc in ~/cptest02 [2:28:02] 
 2 $ ll 
 3 总用量 0
 4 
 5 # usr @ the-pc in ~/cptest02 [2:28:03] 
 6 $ ll ../cptest01/ 
 7 总用量 4
 8 -rw-rw-r-- 1 usr usr    0 10月 11 02:23 11111file
 9 drwxrwxr-x 2 usr usr 4096 10月 11 02:23 pppp
10 
11 # usr @ the-pc in ~/cptest02 [2:28:14] 
12 $ rsync -av ../cptest01/ ./
13 sending incremental file list
14 ./
15 11111file
16 pppp/
17 pppp/adadasd.file
18 
19 sent 187 bytes  received 57 bytes  488.00 bytes/sec
20 total size is 0  speedup is 0.00
21 
22 # usr @ the-pc in ~/cptest02 [2:28:33] 
23 $ ll 
24 总用量 4
25 -rw-rw-r-- 1 usr usr    0 10月 11 02:23 11111file
26 drwxrwxr-x 2 usr usr 4096 10月 11 02:23 pppp
27 
28 # usr @ the-pc in ~/cptest02 [2:28:46] 
29 $ rsync -av ../cptest01 ./ 
30 sending incremental file list
31 cptest01/
32 cptest01/11111file
33 cptest01/pppp/
34 cptest01/pppp/adadasd.file
35 
36 sent 201 bytes  received 58 bytes  518.00 bytes/sec
37 total size is 0  speedup is 0.00
38 
39 # usr @ the-pc in ~/cptest02 [2:28:53] 
40 $ ll 
41 总用量 8
42 -rw-rw-r-- 1 usr usr    0 10月 11 02:23 11111file
43 drwxrwxr-x 3 usr usr 4096 10月 11 02:23 cptest01
44 drwxrwxr-x 2 usr usr 4096 10月 11 02:23 pppp
45 
46 # usr @ the-pc in ~/cptest02 [2:28:56] 
47 $ 

 

(shell是zsh。)

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网