error when copying or overwriting the same directory name linux

my directory structure in linux – centos:

/home/html/prod/wordpress/update/
/home/html/prod/wordpress/

/wordpress/ is my wordpress install, and /update/ is my unziped download files and directories.

The errors I kept getting when trying to move or copy the entire directory while sitting in /home/html/prod/wordpress/update/ was:

mv: cannot move `wp-admin’ to a subdirectory of itself, `../wp-admin’
mv: cannot move `wp-content’ to a subdirectory of itself, `../wp-content’

cp: omitting directory `wp-admin’
cp: omitting directory `wp-content’

what I ended up doing was staying in the same directory ( /home/html/prod/wordpress/update ) and running:

cp -fR * ../

f = force
R = recursive

all went well, replaced the entire directory like I wanted and I just removed the /update directory and done.

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Leave a Reply