I often get anxious about the potential for incomplete data when I consider canceling a file move, regardless of whether I'm using Windows or a Unix-based system. It's sometimes tricky for me to recall how the move command functions in these environments, especially with directories. For example: Does it replicate the entire directory before removing the original, or does it handle each file one at a time, copying then deleting them sequentially?
I always realize, after typing something like mv verybigdir dest
, that I perhaps should have typed cp -R verybigdir dest && rm -R verybigdir
(where the &&
operator proceeds to the next command only if the first was successful) -- or is this pointless? What happens, exactly, when I press Ctrl+C halfway through a move? Likewise, what exactly happens on Windows when I press the cancel button?
I can't count the number of times I've moved something (the last time was when using svn
) and had two directories, with split contents. I guess the answer is difficult because not all applications move groups of files in the same way.