1

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

0

2 Answers 2

2

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

0
1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .