1

I have downloaded files from another server to root directory called public_html, Now I am looking for move all files and folders from public_html to /home/userb/public_html so I am trying to move it like below command

mv -v ~/public_html/* ~/home/userb/public_html/ 

but its giving me error called

mv: target '/root/home/userb/public_html/' is not a directory 

Let me know how I can do it as well its need change permission after move?

Thanks!

1 Answer 1

3

Remove the tilde from /home/userb/public_html/. The tilde expands to the home directory of the user which in this case is root. As a result, you get:

/root/home/userb/public_html/ 

As per the error message, that directory doesn't exist.

What you want instead is this:

mv -v ~/public_html/* /home/userb/public_html/ 

As far as changing the permissions and rights afterwards is concerned, that depends on what they are and what you want them to be. If you want userb to be able to read and edit the files and directories, for example, then you need to make userb the owner which can be done with:

chown -R userb:userb /home/userb/public_html/ 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.