xref: /dragonfly/bin/mkdir/mkdir.1 (revision 3170ffd7)
1.\" Copyright (c) 1989, 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the Institute of Electrical and Electronics Engineers, Inc.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 4. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\"	@(#)mkdir.1	8.2 (Berkeley) 1/25/94
32.\" $FreeBSD: src/bin/mkdir/mkdir.1,v 1.12.2.5 2002/07/14 21:42:14 keramida Exp $
33.\" $DragonFly: src/bin/mkdir/mkdir.1,v 1.4 2008/05/02 02:05:03 swildner Exp $
34.\"
35.Dd January 25, 1994
36.Dt MKDIR 1
37.Os
38.Sh NAME
39.Nm mkdir
40.Nd make directories
41.Sh SYNOPSIS
42.Nm
43.Op Fl pv
44.Op Fl m Ar mode
45.Ar directory_name  ...
46.Sh DESCRIPTION
47The
48.Nm
49utility creates the directories named as operands, in the order specified,
50using mode
51.Li rwxrwxrwx (\&0777)
52as modified by the current
53.Xr umask  2  .
54.Pp
55The options are as follows:
56.Bl -tag -width indent
57.It Fl m Ar mode
58Set the file permission bits of the final created directory to
59the specified mode.
60The
61.Ar mode
62argument can be in any of the formats specified to the
63.Xr chmod 1
64command.
65If a symbolic mode is specified, the operation characters
66.Dq +
67and
68.Dq -
69are interpreted relative to an initial mode of
70.Dq a=rwx .
71.It Fl p
72Create intermediate directories as required.
73If this option is not specified, the full path prefix of each
74operand must already exist.
75On the other hand, with this option specified, no error will
76be reported if a directory given as an operand already exists.
77Intermediate directories are created with permission bits of
78.Li rwxrwxrwx (\&0777)
79as modified by the current umask, plus write and search
80permission for the owner.
81.It Fl v
82Be verbose when creating directories, listing them as they are created.
83.El
84.Pp
85The user must have write permission in the parent directory.
86.Sh EXIT STATUS
87.Ex -std
88.Sh COMPATIBILITY
89The
90.Fl v
91option is non-standard and its use in scripts is not recommended.
92.Sh SEE ALSO
93.Xr rmdir 1
94.Sh STANDARDS
95The
96.Nm
97utility is expected to be
98.St -p1003.2
99compatible.
100.Sh HISTORY
101A
102.Nm
103command appeared in
104.At v1 .
105