[Courses] [FS] supplemental question on cp and mv

Meredydd Luff meredydd at everybuddy.com
Fri Jul 18 20:32:26 EST 2003


Telsa Gwynne said:
> On Wed, Jul 16, 2003 at 03:52:50PM -0000 or thereabouts,
> meredydd at lazzurs.net wrote:
>> cp file1 file2
>>    ...makes a copy of the file "file1" called "file2"
>>
>> mv file1 file2
>>    ...renames "file1" to "file2"
>
> Is this why, on a slow computer or a very busy computer, you see
> a big time difference between mv'ing very large files around (fast)
> and cp'ing them (not so fast)

Indeed it is. 'mv' does not move data around on a disk - it just points a
different path at the same set of data on the disk. 'cp' copies every
byte. One exception is if the 'mv' is happening across different volumes,
in which case it's the same as cp+rm.

Meredydd



More information about the Courses mailing list