Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am executing the following command from my Linux machine.

cp -r hwweb-ws-5.0 /home/tomcat/hwweb-1/webapps/

It's displaying the following error:

cp: cannot create directory `/home/tomcat/hwweb-1/webapps/hwweb-ws-5.0': Permission denied
share|improve this question

migrated from Oct 27 '11 at 18:03

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

Have you checked permissions! – Didier Trosset Oct 27 '11 at 11:00
Most probably you'll need to check who's the owner of the folder by using "ls -l /home/tomcat/hwweb-1/webapps" and then switch to that user by using e.g. "su webapps". After that try copying the folder again and don't forget to switch back to your user by hitting "exit" in the command line. – Stas Oct 27 '11 at 11:06


sudo cp -r hwweb-ws-5.0 /home/tomcat/hwweb-1/webapps/

and then type your super user password. The other way is to change the owner or add your user to the owner group of the /home/tomcat/hwweb-1/webapps/ directory. Obviously, your user doens't have right to write in this directory now.

share|improve this answer
I am not a admin user , how can i add user to the owner group of the /home/tomcat/hwweb-1/webapps/ directory – yyy i 777 Oct 27 '11 at 11:12
As far as I know, you have to be admin user to change permissions on directories. The other way is to execute the copy operation via tomcat user (because the copying is made in the tomcat's home directory). I think this link might be useful to you. – Konstantin Yovkov Oct 27 '11 at 12:03

You must log in to answer this question.