cannot move to a subdirectory of itself

Posted by fire on Server Fault See other posts from Server Fault or by fire
Published on 2011-03-15T15:26:14Z Indexed on 2011/03/15 16:12 UTC
Read the original article Hit count: 281

Filed under:
|
|
|

I have 2 folders:

/home/sphinx/articlesdb/

and:

/home/sphinx/tmp/articlesdb/

I want to move and overwrite all of the files from tmp into the main folder.

I am currently using:

mv -f /home/sphinx/tmp/articlesdb/ /home/sphinx/

But I get this error:

mv: cannot move `/home/sphinx/tmp/articlesdb/' to a subdirectory of itself, `/home/sphinx/articlesdb'

It needs to do this as fast as possible so I don't want to copy.

Should I remove /home/sphinx/articlesdb/ completely and then run the mv command or do I just need to tweak the command slightly?

© Server Fault or respective owner

Related posts about centos

Related posts about bash