TL;DR: No
For a smaller amount of files, you would not need find
but, even in this simplified and smaller case, if you just
mv *.jpg ../../dst/
it will take more time than moving the whole directory at once.
Why? The point is to understand what mv
does.
Briefly speaking, mv
moves a number (that identifies a directory, or a file) from an inode (the directory containing it) to another one, and these indices are updated in the journal of the file system or in the FAT (if the file system is implemented in such a way).
If source and destination are on the same file system, there is no actual movement of data, it just changes the position, the point where they are attached to.
So, when you mv
one directory, you are doing this operation one time.
But when you move 1 million files, you are doing this operation 1 million times.
To give you a practical example, you have a tree with a many branches. In particular, there is one node to which 1 million branches are attached.
To cut down these branches and move them somewhere else, you can either cut each one of them, so you make 1 million cuts, or you cut just before the node, thus making just one cut (this is the difference between moving the files and the directory).
dst
is in a partition whereas../../dst
is on another. – phuclv Jun 01 '16 at 10:53{}
argument where the filename(s) would be expanded. – R.. GitHub STOP HELPING ICE Jun 01 '16 at 20:28find
.find ... -exec mv -t ../../dst/ {} \;
would callmv
once per file;find ... -exec mv -t ../../dest {} +
would be much faster, copying as many files per call as possible, but still not as fast as moving the directory itself as explained by dadexix86. – chepner Jun 02 '16 at 02:35