Is it possible to move files by order of size?
mv /path/to/x /path/to/y
Where x and y are directories. However, smaller files are moved first. Or bigger files first.
Also, is there a reason not to do this?
You could do it like this (untested):
You can reverse the sort by adding the --reverse parameter to ls. If the filenames contain spaces, you might need to quote $file:
If the filenames might contain a double quote, you are in real trouble.
It's also possible that the following could work, but it depends on mv implementation and might also not work for very many files (and it still has problems with spaces and/or quotes in filenames):
You ask: "is there a reason not to do this?" The question should be reversed. Is there a reason to do this? If you have a reason, go ahead and do it.
If you are moving the files within a single filesystem, then the data in the files does not get moved -- only the names of the files are moved between directories. Thus you can move a 10 gigabyte file instantly (within a single filesystem). Thus, to go to the trouble of finding the sizes of all of the files just so the smallest ones can be moved first would be a waste of time (in this case).
A reason not to do that is that it would require you to build an index of all files before moving. Then get the size of all those files and sort them. Before you can even start copying.
And then there is no guarantee that the state you calculated before the copy process is exactly the same during the copy process, thus, making it pointless.