Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mkdir(1) [netbsd man page]

MKDIR(1)						    BSD General Commands Manual 						  MKDIR(1)

NAME
mkdir -- make directories SYNOPSIS
mkdir [-p] [-m mode] directory_name ... DESCRIPTION
mkdir creates the directories named as operands, in the order specified, using mode rwxrwxrwx (0777) as modified by the current umask(2). The options are as follows: -m Set the file permission bits of the final created directory to the specified mode. The mode argument can be in any of the formats specified to the chmod(1) utility. If a symbolic mode is specified, the operation characters ``+'' and ``-'' are interpreted rela- tive to an initial mode of ``a=rwx''. -p Create intermediate directories as required. If this option is not specified, the full path prefix of each operand must already exist. Intermediate directories are created with permission bits of rwxrwxrwx (0777) as modified by the current umask, plus write and search permission for the owner. Do not consider it an error if the argument directory already exists. The user must have write permission in the parent directory. EXIT STATUS
mkdir exits 0 if successful, and >0 if an error occurred. SEE ALSO
chmod(1), rmdir(1), mkdir(2), umask(2) STANDARDS
The mkdir utility is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible. BSD
January 25, 1994 BSD

Check Out this Related Man Page

MKDIR(1)						    BSD General Commands Manual 						  MKDIR(1)

NAME
mkdir -- make directories SYNOPSIS
mkdir [-pv] [-m mode] directory_name ... DESCRIPTION
The mkdir utility creates the directories named as operands, in the order specified, using mode rwxrwxrwx (0777) as modified by the current umask(2). The options are as follows: -m mode Set the file permission bits of the final created directory to the specified mode. The mode argument can be in any of the formats specified to the chmod(1) command. If a symbolic mode is specified, the operation characters ``+'' and ``-'' are interpreted rela- tive to an initial mode of ``a=rwx''. -p Create intermediate directories as required. If this option is not specified, the full path prefix of each operand must already exist. On the other hand, with this option specified, no error will be reported if a directory given as an operand already exists. Intermediate directories are created with permission bits of rwxrwxrwx (0777) as modified by the current umask, plus write and search permission for the owner. -v Be verbose when creating directories, listing them as they are created. The user must have write permission in the parent directory. DIAGNOSTICS
The mkdir utility exits 0 on success, and >0 if an error occurs. SEE ALSO
rmdir(1) COMPATIBILITY
The -v option is non-standard and its use in scripts is not recommended. STANDARDS
The mkdir utility is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible. HISTORY
A mkdir command appeared in Version 1 AT&T UNIX. BSD
January 25, 1994 BSD
Man Page

14 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

mkdir limitations

What characters can't be used with a mkdir? Any limits on length of name? Thank you, Randy M. Zeitman http://www.StoneRoseDesign.com (12 Replies)
Discussion started by: flignar
12 Replies

2. UNIX for Dummies Questions & Answers

Setting up a personal FTP

Ok guys, i dont need a detailed guide from you guys if you dont want to give me one, but i would appreciate maybe a link to a newb step by step guide on how to create your own ftp :) Thanks alot! Jason (19 Replies)
Discussion started by: gearshifter
19 Replies

3. Shell Programming and Scripting

Cp/Mkdir and spaces

I am having trouble using cp and mkdir commands on a small script. The problem is I have spaces what I am trying to mkdir and then copy. Any suggestions on how I can solve this problem? I've tried searching online. while read linefile do echo mkdir -p $CPP$linefile | cut -d / -f 1-5,8-12 ... (10 Replies)
Discussion started by: imagiro1
10 Replies

4. UNIX for Advanced & Expert Users

how to set the default file persmission of file to "rwx"

hi. I want to set the default permission for ever new created file to rwxrwxrwx .. I try umask 000 but it does't not give the execute persmission , is there any way to set the default permission for every new created file to rwxrwxrwx .. thankx (9 Replies)
Discussion started by: tahir23
9 Replies

5. Web Development

Apache 0777 directories

Hi All I have a web server,I have many world writeable directories (0777),Created by programmers,for uploading pictures. Now i want to stop script excuation (php,cgi,etc) in the directories 0777,I know one way is to use htaccess file,i dont wana used that,if some one know any other method... (14 Replies)
Discussion started by: aliahsan81
14 Replies

6. Programming

how to simulate "mkdir -p /home/blah1/blah2/blah3" in "c" where only /home exist

I'm trying to make use of mkdir(char *pathname, S_IRWXU) to create the directories. but it only creates one directory at a time. so I have to separate the tokens for "/home/blah1/blah2/blah3" as "home blah1 blah2 blah3" using delimiter "/", but it is again hectic to create such directory... (8 Replies)
Discussion started by: platinumedge
8 Replies

7. Programming

Improve my shell by adding hierarchical directories.

Hi. im learning unix, and i have problem with my shell . i want to add hierarchical directories. so theshell have mkdir, rmdir and chdir commands. the coding in C language. i looked at the source of mkdir for example, and its very long and complicated. i need simple implementation... (9 Replies)
Discussion started by: evantheking
9 Replies

8. UNIX for Dummies Questions & Answers

Pb commande externe \r

J'ai un soucis avec une commande externe... la voici : #!/bin/bash/ mkdir lol mkdir not sleep 2 mkdir glop Mon bash l'éxécute (déjà ça :rolleyes:) à sa façon..... Je me retrouve avec non pas 3 dossiers lol, not et glop. Mais les dossiers : lol?, not? et glop (oui ! un de bon !!!!!). Et, une... (9 Replies)
Discussion started by: sluvah
9 Replies

9. UNIX and Linux Applications

mkdir: cannot create directory

Hi, I have network mount on two servers. One server I can create any directories without any issues, other server with the similar mount, I am not able to create directories starting with number! Creation, name start with a number: $ mkdir 1212 mkdir: cannot create directory `1212': No such... (12 Replies)
Discussion started by: ./hari.sh
12 Replies

10. UNIX for Dummies Questions & Answers

How to create a file with 777 permission.?

Hi Guys, I want to know is there any method to create a file having 777 permission. I am aware of umask, since it is only giving max. 666 permission for files this is not fulfilling my needs. Thanks in advance ---------- Post updated at 12:49 AM ---------- Previous update was at 12:31... (10 Replies)
Discussion started by: sanoop
10 Replies

11. Red Hat

Can't run mkdir even as root please help

I cannot mkdir as root please see below # mkdir /home/vm1/Desktop/nfs mkdir: cannot create directory `/home/vm1/Desktop/nfs': Permission deniedso i checked the selinux context below and got # ls -Z /home/vm1 drwxrwxrwx. root root system_u:object_r:autofs_t:s0 Desktop drwxr-xr-x. vm1 ... (10 Replies)
Discussion started by: nokia3310
10 Replies

12. Shell Programming and Scripting

MV file with other permission

Hello All I have a file with rw-rw-r permission I need to mv the file into different directory (dir has rwx-rwx-rwx permission) with an others permission The application which is moving the file falls in other group I am getting the error mv cannot renamed permission denied ... (12 Replies)
Discussion started by: Pratik4891
12 Replies

13. Shell Programming and Scripting

How to create a long list of directories with mkdir?

Hi... Thanks to read this... I want to use mkdir to create many directories listed in a text file, let's say. How do I do this? Sorry for this maybe very basic question :) (13 Replies)
Discussion started by: setub
13 Replies

14. Shell Programming and Scripting

Cd then mkdir from script

Importing images from a camera (or two). I sort by date (1901 this month). Currently (failing) if ] then echo "Found Panasonic G9X" #echo "List files on camera" #ls ${pana}/* . chxdir.sh ${photos}/$mn I want to change directory to a fixed base ($photos)/$mn... (10 Replies)
Discussion started by: dpawson
10 Replies