Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

can anybody help me in solving this issue. I am new to Linux and here's problem:

gourab@gourab-RV509:/usr/share/java$ cd /
gourab@gourab-RV509:/$ cd usr
gourab@gourab-RV509:/usr$ mkdir JAVA
mkdir: cannot create directory `JAVA': Permission denied
gourab@gourab-RV509:/usr$ 
share|improve this question

3 Answers 3

up vote 4 down vote accepted

Instead of mkdir JAVA use sudo mkdir JAVA, then enter your password.

That should fix it.

However, you only really need to use one command instead of these two or three.

cd / 
cd usr 
sudo mkdir JAVA 

cd just changes the directory, no point in doing that. You can simply put the path of the file after mkdir, like so.

sudo mkdir /usr/JAVA
share|improve this answer
    
Thanks for supporting !! worked 100% fine –  grv.giit Jan 1 '13 at 15:10
    
@grv.giit You can also use sudo -i to elevate to root, then do all future commands(until you close the terminal) without the sudo. –  hexafraction Jan 1 '13 at 15:40
    
@ObsessiveSSOℲ: thanks got it this will solve my problem –  grv.giit Jan 1 '13 at 15:54

Permission denied means you have to be a superuser or root to create files/folder on a specific directory. So to create folder that needs a root permission, you need to simply add sudo before your command: sudo mkdir -p JAVA

share|improve this answer
    
worked perfectly for me . Thanks for support !! :) –  grv.giit Jan 1 '13 at 15:09

In order to create a directory in any folder other than /home/username, where username is your account's username, you need to prepend mkdir with sudo, so create the folder like this:
sudo mkdir JAVA

share|improve this answer
    
Thanks friend . This really worked for me !! :) –  grv.giit Jan 1 '13 at 15:09

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.