Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm looking for the linux equivalent of the DOS command:

xcopy from/* to/* /s/e/d/y

Which copies over all new files and only replaces old ones. I'll be running this from the terminal of a Mac OSX computer.

share|improve this question
    
If rsync is available on your platform, go for it! –  gniourf_gniourf Oct 31 '13 at 15:25
    
"copies over all new files and only replaces old ones" - so it copies all files from directory from/, and overwrites files of same name that exist already in directory to/ ? –  Joachim Wuttke Oct 31 '13 at 15:25
    
are /s and /e not contradictory? –  Anthon Oct 31 '13 at 15:26
    
@Joachim It copies over any files that don't already exist at the target directory, and replaces older files at the target. –  Matt Oct 31 '13 at 15:32
add comment

2 Answers 2

I normally use find for this:

cd from
find * -print0 | cpio -pdmv0 to/
share|improve this answer
add comment

Basically cp -f from/* to/. But I don't know the meaning of all the options to your DOS command; maybe you have to choose additional options here, man cp.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.