Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mkdir(1) [opendarwin 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

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

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

2. UNIX for Dummies Questions & Answers

512 Error while creating a directory

Hi, I came across this strange error while creating a directory using mkdir command. The command created the directory but it returned an error code 512. Could some one tell me why this error popped up and what exactly does an error code 512 infer? (11 Replies)
Discussion started by: shreyasjothish
11 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. Shell Programming and Scripting

find files from the past 7 days

Hi All, I have a file which contains the listing of another directory: >cat list.dat -rwxr-xr-x 1 test staff 10240 Oct 02 06:53 test.txtdd -rwxrwxrwx 1 test staff 0 Oct 04 07:22 test.txx -rwxrwxrwx 1 test staff 132 Sep 16 2007 test_tt.sh... (6 Replies)
Discussion started by: deepakgang
6 Replies

6. 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

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 for Dummies Questions & Answers

How to set default permission

Hey Guys, First post here. I just started learning UNIX a few weeks ago. My issue: I use FreeNAS which is based off of UNIX in my network environment which hosts files that my team needs to access. Each user has their own login but we are all part of a group called "ITLIC". I have a share... (15 Replies)
Discussion started by: uglycustoomer
15 Replies

10. Shell Programming and Scripting

Looping inside directories based on a file which contains file directory list

Hi All, Please help. I have got a file which contains a listing of a file and some directories after it, one by one. I am calling this file xyz.txt here file1 dir1 dir2 dir3 dir4 file2 dir5 dir6 dir7 dir8 file3 dir9 dir10 dir11 dir12 (6 Replies)
Discussion started by: Piyush Jakra
6 Replies

11. 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

12. AIX

How to set owner and permission for files/directory in directory in this case?

Hi. My example: I have a filesystem /log. Everyday, log files are copied to /log. I'd like to set owner and permission for files and directories in /log like that chown -R log_adm /log/* chmod -R 544 /log/*It's OK, but just at that time. When a new log file or new directory is created in /log,... (8 Replies)
Discussion started by: bobochacha29
8 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