Skip to main content
removal of [copy] as per meta cleanup effort: http://meta.superuser.com/q/8254/107240
Link
AlbertEngelB
  • 1.1k
  • 2
  • 11
  • 20

Recursive, Non-Overwriting File Copy?

removal of [copy] as per meta cleanup effort: http://meta.superuser.com/q/8254/107240
Link

Recursive, Non-Overwriting Copy?

Source Link
AlbertEngelB
  • 1.1k
  • 2
  • 11
  • 20

Recursive, Non-Overwriting Copy

I've got a directory that contains a bunch of other folders containing CoffeeScript/ JavaScript files. I'm able to compile the CoffeeScript files into a new folder with the same folder structure fine.

What I want to do is copy all the *.js files in the source folder to the destination folder recursively. I also don't want to overwrite any files that are already present in the destination folder. Any thoughts of how to accomplish this?

I tried using cp -n source/**.js desination/ and cp -Rn source/**.js desination/ after looking at another similar question, but it doesn't seem to be working.

Any idea how to accomplish this?