[mythtv-users] Adding new 1 Terabyte Drive and Moving existing Recordings

Jan Ceuleers jan.ceuleers at computer.org
Wed Jan 7 16:25:23 UTC 2009


Brent Norris wrote:
> mv is funny like that.  If you feed it a list of files:
> 
> mv *.avi /path/to/new/
> 
> then it deletes each file after it copies it and does not move on until 
> that file is deleted
> 
> if you instead feed it:
> 
> mv /path/to/old/ /path/to/new/
> 
> it will move the whole old directory including the folder and it copies 
> everything, then deletes at the end.  I don't know why it is done that 
> way, but that is how it does it.

It's because in the first example a wildcard is involved. Wildcards are 
expanded by the shell before invocation of the mv command. So mv gets a 
whole load of arguments, the last of which is /path/to/new/ and the 
preceding-ones are individual files ending in .avi to be moved.

In the second example mv is given only two arguments, both of which are 
directories.

So mv apparently deals with each argument in turn (except for the 
last-one which acts as the destination), copying first and then deleting 
the original.

Cheers, Jan



More information about the mythtv-users mailing list