mkdir's "-p" option mkdir's "-p" option unix unix

mkdir's "-p" option


The man pages is the best source of information you can find... and is at your fingertips: man mkdir yields this about -p switch:

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

Use case example: Assume I want to create directories hello/goodbye but none exist:

$mkdir hello/goodbyemkdir:cannot create directory 'hello/goodbye': No such file or directory$mkdir -p hello/goodbye$

-p created both, hello and goodbye

This means that the command will create all the directories necessaries to fulfill your request, not returning any error in case that directory exists.

About rlidwka, Google has a very good memory for acronyms :). My search returned this for example: http://www.cs.cmu.edu/~help/afs/afs_acls.html

 Directory permissionsl (lookup)    Allows one to list the contents of a directory. It does not allow the reading of files. i (insert)    Allows one to create new files in a directory or copy new files to a directory. d (delete)    Allows one to remove files and sub-directories from a directory. a (administer)    Allows one to change a directory's ACL. The owner of a directory can always change the ACL of a directory that s/he owns, along with the ACLs of any subdirectories in that directory. File permissionsr (read)    Allows one to read the contents of file in the directory. w (write)    Allows one to modify the contents of files in a directory and use chmod on them. k (lock)    Allows programs to lock files in a directory. 

Hence rlidwka means: All permissions on.

It's worth mentioning, as @KeithThompson pointed out in the comments, that not all Unix systems support ACL. So probably the rlidwka concept doesn't apply here.


mkdir [-switch] foldername

-p is a switch which is optional, it will create subfolder and parent folder as well even parent folder doesn't exist.

From the man page:

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

Example:

mkdir -p storage/framework/{sessions,views,cache}

This will create subfolder sessions,views,cache inside framework folder irrespective of 'framework' was available earlier or not.


-p|--parent will be used if you are trying to create a directory with top-down approach. That will create the parent directory then child and so on iff none exists.

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

About rlidwka it means giving full or administrative access. Found it here https://itservices.stanford.edu/service/afs/intro/permissions/unix.