rsync

rsync的一些小功能

cp功能:
复制目录:
rsync  -r /etc  /tmp

复制文件 
rsync  -a /etc/hosts  /tmp   

scp远程复制功能:
rsync /etc/hosts 10.0.0.4:/tmp

ls功能:
rsync chenleilei/123.txt
-rw-r--r-- 0 2018/05/03 21:35:51 123.txt

rm功能(只能删除目录内的所有文件)
清空目录
rsync --delete -r  null/  data/ 
清空文件内容
rsync -r --delete /null.txt  /opt/hosts 
原文地址:https://www.cnblogs.com/wuhg/p/12609157.html