If I execute the following command:
cp -R /myfiles /mydestination
If myfiles contains several sub-directories and files, in what order will they be copied?
For example, directories might be named 0123a, 9993c, myfolder, xfolder.
They are not copied in alphabetical order OR in date order OR in the order they appear when using a standard ls command as far as I can tell, so what actually does determine the order?
Edit: I am trying to determine the order that the cp command uses in order to determine how far along my copy command made it before it stopped. For example, I was hoping to be able to determine it copied 3 of the 4 directories successfully.
lscommand by default sorts the directory contents before displaying them. What you see printed bylsis not the actual directory enumeration order. – JdeBP Jun 26 '11 at 14:09ls -Uto get the unsorted directory order. This should be the order thatcpuses. If you need more control over progress, order, etc., perhapscpis not the tool for the job. – Daniel Andersson May 11 at 8:16