can anyone tell me why when I type:

mv -f ./tmp/members ./

I get:

mv: cannot move `./tmp/members' to a subdirectory of itself, `./members'

And moreover the correct way to move this directory?

Also, there is already a directory at ./members ... I want to completely overwrite this directory, not just add the new contents to it.

I've discovered that this works:

mv tmp/members members

but only for new contents... the old contents are still left behind...

Thanks!

-Eric

link|improve this question
1  
Please try asking on superuser.com - SO is intended for programming questions. – Bayard Randel Jul 20 '10 at 0:46
Crossposted on ServerFault (please don't crosspost). – Dennis Williamson Jul 20 '10 at 1:21
1  
We need to know what directory you are in when you run the command because ./ means the current directory. – James T Jul 20 '10 at 4:55
I just gave it a try in OS X and couldn't replicate your issue. Does it possibly depend on the flavour of Linux you're using? – dtlussier Oct 1 '10 at 14:00
feedback

migrated from stackoverflow.com Jul 20 '10 at 0:55

This question came from our site for professional and enthusiast programmers.

1 Answer

If you are in /tmp when you run the first one, that would account for the error message. The easiest way to do what you want is to rm -rf the target and then mv the original dir to that location.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.