I work with folders that contain a lot of files, like 100 000 or even 1 000 000 files per folder. When I try to move the content of a folder into another, my computer always gets stuck. Even when the process seems finished, I can't see the content of any folder because nautilus seems completely frozen and I have to force my computer to restart. I noticed that this happens also when I try to move like 10 000 files.
Is that a problem of my computer or is it normal when working with these numbers?
Any smart way of performing this file transfer?
Best Answer
Perhaps consider using a pure command line method to transfer very large amounts files, you will undoubtedly find the process is substantially faster than using a gui.
There are many different ways to accomplish this, but the following worked quickly, safely and efficiently on my system:
Some explanation for this command:
<destination>
in my example. Obviously modify this to suit your own needs and leave out the brackets.Endless permutations are possible but this should work well and much more efficiently than the gui. One permutation for example: if you wanted to move only pdf files you could run:
Use of
xargs
opens many possibilities particularly with the movement of such a large number of files. Many, many possibilities....Potential Problems:
There are at least 2 potential pitfalls to ponder, thanks to the commenters below for these thoughts:
mv
will still move the files there! Be careful here...-t
option (--target-directory
) is missing and the destination folder is actually a file you will move one file and fail on the rest.mv
has 2 uses: rename source to destination or move source to directory. Again be careful...