Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

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

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

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

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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