Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


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

obscure mv behavior?



Unix commands often treat directories differently depending on the  
presence of the trailing slash. For example, there may be a  
difference between:

mv srcDir trgDir

and

mv srcDir/ trgDir

Just a guess, easy enough to test, but I'm lazy. Its an easy trap to  
fall into with tab-completion.

-Josh

On Jul 15, 2005, at 11:51 AM, Ken Gosier wrote:

> Hi, I'm getting a little funny behavior out of mv. Most times when  
> I want
> to move a directory, I can just do:
>
> mv srcDir trgDir
>
> and everything's fine. (That is, srcDir will no longer be there,  
> and now I
> will have a directory trgDir/srcDir.) Sometimes, however, I get the  
> error
> message:
>
> mv: srcDir is a directory
>
> I haven't been able to figure out the special circumstances under  
> which I
> get this message. (It happens randomly, as far as I can tell.) btw,  
> I'm
> running on Solaris 2.6. Also, if I explicitly say:
>
> mv srcDir trgDir/srcDir
>
> then it works correctly. Does anyone know what's going on here?
>
> -- 
> Ken Gosier
> ken at kg293.net
> ken_gosier at yahoo.com
> _______________________________________________
> Discuss mailing list
> Discuss at blu.org
> http://olduvai.blu.org/mailman/listinfo/discuss
>





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org