Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 3
    I know the OP already completed his task which prompted the question, but hopefully this answer can help anyone with this problem in the future. Commented Jan 31, 2015 at 7:36
  • 1
    This really the answer they needed. I just did this with 60GB of thousands of small cyrus email files and it took only 21 seconds. Commented May 12, 2015 at 18:37
  • 2
    This is also the route I took - I just changed it to cp -al source destination to preserve owner info and permissions. Commented Nov 20, 2015 at 9:32
  • I think to actually do what OP asked for you have to add the -f option otherwise it will not overwrite if the file exists. Can you confirm that or am I doing something wrong? Commented Jan 17, 2018 at 23:40
  • @dasKeks: Actually, cp overwrites by default. The -f option attempts to remove the file (as in rm) before trying to copy anew, which can help if the process can't open the file for writing, though some people would prefer to see that there was an error instead. I don't know if it mattered to the OP, but I added the -f flag to my answer anyway. Commented Jan 18, 2018 at 0:53