Often a mv
is closer to a rename than a copy. In a classic unix type file system, the inodes that contain the file data won't be replicated if the source and the destination are on the same mount point. Instead a new filename is created that points to the same inodes, and the old filename is unlinked.
If the mv
is to another mount point, then it will be an actual copy. What fraction of it is in RAM at a time is an OS detail whose transparency to the user is not defined.
Just to give an example, if the data was considered actually copied to a new place, the file might be, to the user, conceptually 'written' to the disk. But it could, at the OS level, actually be residing in a buffer that hasn't been flushed to the hardware yet.
mv
is when I have a limited size of a memory. Is it (not) likely to run out of memory when usingmv
since it is managed "inside the command"?