Copying only updated and new files
Published on 20th October 2008 Estimated Reading Time: 1 minuteWith Linux/UNIX, the command line remains ever useful and allows you to do all manner of things, including file copying that only adds new files to a destination. Here's a command that accomplishes this on Linux:
cp -urv [source] [destination]
The u
switch does the update while r
ensures recursion (by default, cp
only copies files from a source directory and not anything sitting in subfolders) and v
tells the command to tell the user what is happening.
Though buried and hardly promoted, Windows also has its command line and here's what accomplishes a similar result:
xcopy /d /u [source] [destination]
Anything's better than having to approve or reject every instance where source and destination files are the same or, even worse, to overwrite a file when it is not wanted.