Let's assume I want to copy or move many files from my mobile phone to the PC overnight.

I go to bed and wake up next morning, just to read a message that states “Error while copying ……… – libmtp error: Could not get file from device.”, that came at 3% and halted the file transfer. So one tiny fault delayed the entire progress (the other 97%) of the file copying.

It would be better if it could first copy all files that can be copied, and then handle file conflicts (existing filename, unsupported characters for target file system, other errors) last, so that it can first get all the work done and then handle the faults.

It would also be good if I could tell the file copier in advance to rename existing files automatically, so that I do not have to wait for the file copier to encounter these files so I can tell it to rename files automatically.


Assuming you are using the default file manager in Ubuntu:

  1. Right-click the folder containing the files on your phone you want to transfer to your PC, then click Open in Terminal.
  2. Run one of these two commands (copy or move), replacing <target> with the destination path:
cp -r --backup=numbered * <target>
mv -r --backup=numbered * <target>

This will rename the target file with a .~1~ suffix if there is a file name conflict. If a file ending with .~1~ exists, .~2~ is used, and so on.

  • I will try it out. I guess I have to use the bogus mtp-fuse when using MTP, in order to simulate a normal file system. But thanks alot, and welcome to StackExchange. Don't get intimidated if you get yelled at, that's normal on StackExchange and I had to deal with it alot. – neverMind9 Jun 10 '19 at 22:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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