You are not logged in.

#1 2008-09-11 16:00:47

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

[SOLVED] mkdir: can't make nested directories as normal user

so a pretty basic question, hoping someone can show me what's going on.

obviously, it's infinitely more convenient to do this:

mkdir path/to/dir/

than this:

mkdir path/
cd path/
mkdir to/
cd to/
mkdir dir/

as root, the one line creation works great... as root.  when i do it as a normal user, it complains that it can't create the directory because the directory doesn't exist. [this occurs even within my home folder, where i have full permissions]

is there some setting to extend this functionality to a normal user?

thanks in advance.

[EDIT]: solved... mkdir -p path/to/dir

Last edited by brisbin33 (2008-09-11 17:36:26)

Offline

#2 2008-09-11 16:36:10

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: [SOLVED] mkdir: can't make nested directories as normal user

man mkdir wrote:

-p, --parents
              no error if existing, make parent directories as needed

$ mkdir sandbox/a/b/c
mkdir: cannot create directory `sandbox/a/b/c': No such file or directory
$ mkdir -p sandbox/a/b/c
$ ls sandbox/a/b
c

Offline

#3 2008-09-11 17:35:51

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: [SOLVED] mkdir: can't make nested directories as normal user

much appreciated; i guess man mkdir shoulda been my first stop.

i'll change the subject to [SOLVED] but any idea why the -p isn't needed when executed as root?

Offline

Board footer

Powered by FluxBB