Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
great question. thank you –  dino Jul 23 '11 at 15:50

2 Answers 2

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 "..".

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

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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