LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-08-2006, 04:11 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
MKDIR Error?


Anyone know why I received this error? I don't understand and I thought I was doing this correctly.

As you can see I am "cwilliams" and am in my own home directory however I got a strange permission denied error yet it still made the 2 directories I requested.

Code:
cwilliams@cwilliams:~$ pwd
/home/cwilliams
cwilliams@cwilliams:~$ man mkdir
Reformatting mkdir(1), please wait...
cwilliams@cwilliams:~$
cwilliams@cwilliams:~$ mkdir -p /pics/wallpaper
mkdir: cannot create directory `/pics': Permission denied
cwilliams@cwilliams:~$ whoami
cwilliams
cwilliams@cwilliams:~$ pwd
/home/cwilliams
cwilliams@cwilliams:~$ mkdir pics
mkdir: cannot create directory `pics': File exists
cwilliams@cwilliams:~$ ls
Desktop  pics
cwilliams@cwilliams:~$ cd pics/
cwilliams@cwilliams:~/pics$ ls
wallpaper
 
Old 12-08-2006, 04:18 PM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Code:
cwilliams@cwilliams:~$ mkdir -p /pics/wallpaper
mkdir: cannot create directory `/pics': Permission denied
The output here is correct because you need to be root to create a subdirectory in /.

As for the rest, its a bit puzzling. Are you sure pics/wallpaper did not exist before?

Last edited by reddazz; 12-08-2006 at 04:32 PM.
 
Old 12-08-2006, 04:21 PM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Wow - I am pretty embarrassed I did not realize I was trying to create a dub dir under the root dir. I thought it was under my home dir. Sorry for the brain fart.
 
Old 12-08-2006, 04:39 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
That is how we learn. "/" is a powerful character---one too many or one too few and you wind up not where you expected to be.....
 
Old 12-08-2006, 04:40 PM   #5
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Thanks! I see my mistake.
 
Old 12-08-2006, 05:18 PM   #6
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Quote:
Originally Posted by pixellany
That is how we learn. "/" is a powerful character---one too many or one too few and you wind up not where you expected to be.....
Well said. I learnt that the hard way and ended up with a broken system.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mkdir -p ? shanenin Linux - Software 4 10-19-2011 11:41 AM
mkdir recompilation puishor Programming 4 06-25-2005 04:37 PM
mkdir help... Linux~Powered Linux - Software 2 06-13-2004 11:27 AM
mkdir help ITJedi Linux - Software 1 05-14-2004 05:19 PM
Strange mkdir error/behavior : Mandrake ManK Linux - General 4 10-17-2003 01:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration