RE: mv command behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



But then we have the problem that:

mv: cannot move '/tmp/dirA/dirB' to a subdirectory of itself '/dirC/dirB'

Best regards,
Peter Lauri

www.dwsasia.com - company web site
www.lauri.se - personal web site
www.carbonfree.org.uk - become Carbon Free

> -----Original Message-----
> From: fedora-list-bounces@xxxxxxxxxx [mailto:fedora-list-
> bounces@xxxxxxxxxx] On Behalf Of Steve Searle
> Sent: Monday, July 09, 2007 8:04 PM
> To: For users of Fedora
> Subject: Re: mv command behavior
> 
> Around 05:00pm on Monday, July 09, 2007 (UK time), lists@xxxxxxxxxxx
> scrawled:
> 
> > Hi, I don't know if I already sent this question or not, my server
> > died before, and I havn't been able to receive the mails for a while.
> >
> > I want to move the files from one dir to another, but only if they are
> > newer. So I do:
> >
> > mv -u /tmp/dirA/dirB /dirC/dirB
> >
> > Meaning moving it from being a subdir of /tmp/dirA to be a subdir of
> /dirC.
> >
> > The first time it works, but the next time it will end up being like
> this:
> >
> > /dirC/dirB/dirB :(
> 
> You should have done:
> 
> mv -u /tmp/dirA/dirB /dirC
> 
> This will put dirB as a sub directory of /dirC.  The only reason it
> worked the first time as you expected was because /dirC/dirB didn'e
> exist, so it realised that you wanted the directory moveing.  Once it
> already exists, it assuems you want to move the direcory into the path
> given in the second argument.
> 
> I haven't explained this vey well, but I am sure man 'mv will'.
> 
> Steve
> 
> --
> 
>  Play Champions - my free football predictions game at:
>  	http://www.stevesearle.com/champs/about.html
> 
>  20:00:23 up 13 days, 23:39,  1 user,  load average: 0.13, 0.10, 0.10

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux