I have the following structure on my server:

/www/html/www->content

I want to copy the content (all files) from the last www to html and delete the second www after that. How do I have to do that?

link|improve this question
1  
This is not a programming question. It belongs on superuser.com – Gabe Sep 10 '10 at 19:25
feedback

migrated from stackoverflow.com Sep 11 '10 at 2:10

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

3 Answers

sudo cp /www/html/www/* /www/html/

then

sudo rm -r /www/html/www
link|improve this answer
I am getting an error, if I sue the command. the error says, that the file or directoty could noz be found. I Used thsi command: – chris Sep 10 '10 at 19:33
sudo cp /www/html/www/* /www/html/ – chris Sep 10 '10 at 19:39
feedback

In sh:

mv /www/html/www/* /www/html/ && rmdir /www/html/www
link|improve this answer
feedback

I recommend rsync:

sudo rsync -avz /www/html/www/ /www/html/

It's what I use to create backups. It syncs files on copy when copying across different hard drives, -a takes care about file access rights and ownership. When copying across servers, -z uses compression.

After that, delete the dir:

sudo rm -f /www/html/www
link|improve this answer
feedback

Your Answer

 
or
required, but never shown