Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .