linux学习之 rsync VS. cp
来源:互联网 发布:阿里云 nodejs 编辑:程序博客网 时间:2024/05/19 00:15
Use Rsync Instead of Cp
I tend to use rsync when others would typically use a simple cp for copying files. A few reasons:
- It can be canceled in the middle, and resumed later.
- It can show a progress bar that (while not perfect) is great for large files or lots of files.
- It will only copy the changed files and won’t clobber already existing directories of files at the target.
rsync is available on Linux, Mac, and there’s a binary somewhere on teh intarwebs for Windows.
To use, you almost always want to pass the -a
flag, which stands for “archive” – basically a convenience flag for -r
(recursive), -p
(permissions), -t
(timestamps), and a few others. I can’t think of a time I haven’t used -a
when using rsync.
Following that, basic usage looks like this:
The other thing to remember when using rsync is that it’s picky with slashes; if you put a trailing lash on a path, then rsync takes that to mean you want to copy the contents of that path. If, on the other hand, you leave off the slash, it will copy the path and its contents. A few examples will help:
Some other handy arguments:
--stats
--progress
So, to put it all together:
And, better yet, rsync can work over ssh (if it’s installed on both hosts). Just put an ssh host on the front of either path:
or
So, there you have it. rsync can do tons more stuff, but this is a great start. If this is all you learn of rsync, you will be that much better off.
- linux学习之 rsync VS. cp
- linux 拷贝命令 cp ,scp ,rsync
- linux之cp命令grep命令学习
- Linux基础学习笔记之cp命令
- Linux cp命令学习
- linux命令之cp
- Linux命令之"cp"
- linux 命令 之 cp
- linux命令之cp
- Linux命令中:rsync和cp之间的区别
- Linux之rsync
- linux之rsync命令
- Linux 之 rsync
- linux之rsync
- rsync 取代 cp
- 菜鸟的Linux学习笔记之命令cp
- Linux每天学习一个命令之cp命令
- linux命令学习-文件目录之cp命令
- java web注册实现邮箱验证
- CocoaPods安装和使用教程
- 近段时间处理JT809大量数据方式
- 第1章 述与环境搭建
- 1子级div margin属性影响父级div margin属性
- linux学习之 rsync VS. cp
- MyEclipse安装插件的几种方法
- Rails new, build, create, save方法区别
- maven jetty基本命令
- Android之Home键监听
- Android如何加载硬件OpenGLES库
- iOS XCode4.6.3 SVN 配置
- 机房收费系统 类图
- ios tableview 那些事(二十一) 使你的自定义tableviVCells 更加平滑