I Have a directory say abc in var/www/ on my server

Now i want to move all the content of abc/ directory to var/www/

What will the linux command for this. New bie in linux

link|improve this question

75% accept rate
great question. thank you – dino beytar Jul 23 '11 at 15:50
feedback

2 Answers

up vote 2 down vote accepted

mv

I understand that you want to move content of /var/www/abc to /var/www, right?

Then do

mv /var/www/abc/* /var/www

This will omit files with names starting with . (a dot). If you have any (check it with ls -l /var/www/abc) you can do

mv /var/www/abc/.* /var/www

Ignore the errors about "." and "..".

link|improve this answer
and great answer here.. thanks – dino beytar Jul 23 '11 at 15:52
feedback

Assuming the directory you are referring to is /var/www,

Something like this will work:

mv /var/www/abc/* /var/www

This will move everything in /var/www/abc/ into the /var/www/ directory. This will leave the /var/www/abc/ directory where it is but it will be empty.

Be aware that what you wrote (var/www) is a relative directory rather than the absolute path from root (/) - so it means relative from your current working directory. If this is what you actually wanted, drop the leading slashes in the source and target directories.

You can read more about the options for the mv (move) command by running:

man mv

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.