[root@hanfeng ~]# rsync -av /etc/passwd /tmp/1.txt //把/etc/passwd文件拷贝到/tmp下并改名为1.txt
sending incremental file list
passwd
sent 957 bytes received 31 bytes 1976.00 bytes/sec
total size is 883 speedup is 0.89
[root@hanfeng ~]#
-比如,拷贝到对方机器root用户下 - 然后在root后加IP,并用 : 冒号分开,再跟文件的根路径
- 并输入root用户的密码
[root@hanfeng ~]# rsync -av /etc/passwd root@192.168.202.130:/tmp/1.txt //将/etc/passwd文件拷贝到root用户192.168.202.130IP地址下,并用 : 冒号分开,再跟文件的根路径
root@192.168.202.130's password: //这里写用户的密码
sending incremental file list
sent 31 bytes received 12 bytes 0.43 bytes/sec
total size is 883 speedup is 20.53
[root@hanfeng ~]#