Jump to content
  • Advertisement
Sign in to follow this  
Lucidquiet

Updating a directory

This topic is 4811 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a directory that I want to update with newer files from another directory. Is there a simple way of doing this from the command line. I thought that maybe copy would have a flag, but I'm not seeing this. Sorry if this is a real newbie question... L-

Share this post


Link to post
Share on other sites
Advertisement
cp dir_with_new_files/* dir_with_old_files

This just overwrites the files with the same name

Share this post


Link to post
Share on other sites
If you mean that you have two directories, say dir_a and dir_b, and you want to copy the contents of dir_a into dir_b but only overwrite where the file is newer - ie. if the file is older, don't update - then you need the -u or --update option. "copy only when the SOURCE file is newer than the destination file or when the destination file is missing"

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!