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*

14
  • Thanks terdon, the only issue with this is that there are 4000+files and as the error is printed after each copy, it would be difficult for me to monitor if one of the files was not located. I will update my question to include the fact that I would like a fail summary at the end, rather than after each copy action. Commented Feb 29, 2016 at 13:59
  • @bms9nmh OK, that's easy enough. Give me a second to edit. Also note that I had an bug in the original version and the message was printed for files that were copied, not those that weren't. And is having the same file name a potential problem? Commented Feb 29, 2016 at 14:00
  • ok thanks for that i'll wait and see your edit, I'm not 100% sure about the same name issue, its definitely a possibility though now you mention it. Commented Feb 29, 2016 at 14:05
  • @bms9nmh OK, the simplest solution would be to use cp -i (assuming you're on a Linux system or have access to GNU cp) which will prompt you before overwriting. That, however, means that you will have to interact with the script. If that's an issue, I can make it so that it will move file to file1, then file2 etc. What do you prefer? Commented Feb 29, 2016 at 14:09
  • @bms9nmh I went with the version that increments the file name. Commented Feb 29, 2016 at 14:18