It’s kind of funny, there are a lot of ways in which Linux command line tools are vastly superior to Windows ones, but one thing I have not found an equivalent to is robocopy. Robocopy is way more versatile than cp
, and I can’t figure out how to do what I want with Linux tools.
A specific use case is that I have two directories with mostly similar files, but one has newer source files and one has content files that the other directory doesn’t have, and possibly newer source files (for a website). I want to copy the files from the latter directory into the former, adding new content files and such, but not overwriting newer files in the destination directory.
I tried to figure out how to do this in Linux for maybe half an hour, decided that I’d probably have to learn bash scripting or something to do what I wanted, and then I realized that I could just use robocopy. I also had some other requirements. I was basically converting a Python (Django) website from an SVN repository to a Git repository, and I wanted to make sure I didn’t have uncommitted changes in SVN. However, I wanted to conditionally exclude the .svn
directories and the .pyc
compiled Python files. The following robocopy command does exactly what I want:
robocopy source destination /XO /E /XD .svn /XF *.pyc
Is there any equivalent to Robocopy in Linux? I looked into rsync
briefly, but it seemed like I’d have to set up an rsync server before attempting to sync the folders.
robocopy
is the one Windows cmd tool that is better than Linux.rsync
is powerful, but it's not as easy to use asrobocopy
.