Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mv: "Directory not Empty" - how do you merge directories with `mv`?

Tags:

mv

I tried to deploy my personal blog website to my remote server recently. When I tried to move a few files and directories to another place by executing mv, some unexpected errors happened. The command line echoed "Directory not Empty". After doing some googling, I tried again with '-f' switch or '-v', the same result showed. I logged in on the root account, and the process is here:

root@danielpan:~# shopt -s dotglob
root@danielpan:~# mv /var/www/html/wordpress/* /var/www/html
mv: cannot move `/var/www/html/wordpress/wp-content` to `/var/www/html/wp-content`: 
Directory not empty
root@danielpan:~# mv -f /var/www/html/wordpress/* /var/www/html
mv: cannot move `/var/www/html/wordpress/wp-content` to `/var/www/html/wp-content`:
Directory not empty

Anybody know why?

(I'm running Ubuntu 14.04)

like image 754
SilentKnight Avatar asked Mar 19 '15 01:03

SilentKnight


1 Answers

If You have sub-directories and "mv" is not working:

cp -R source/* destination/ 
rm -R source/
like image 161
John Tribe Avatar answered Sep 27 '22 15:09

John Tribe