Saturday 23 December 2017

linux - Copying a file only when it is newer than the destination


How do I copy a file in Linux only when the file being copied is newer than the version at the destination?


If the file at the destination is newer, I want the file copy to not go ahead.



Answer



Using the update option (-u) with cp should do it for you.


http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/cp-linux-copy-command/


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...