xref: /original-bsd/bin/mkdir/mkdir.1 (revision 3b235ced)
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.\" %sccs.include.redist.roff%
8.\"
9.\"	@(#)mkdir.1	8.2 (Berkeley) 01/25/94
10.\"
11.Dd
12.Dt MKDIR 1
13.Os
14.Sh NAME
15.Nm mkdir
16.Nd make directories
17.Sh SYNOPSIS
18.Nm mkdir
19.Op Fl p
20.Op Fl m Ar mode
21.Ar directory_name  ...
22.Sh DESCRIPTION
23.Nm Mkdir
24creates the directories named as operands, in the order specified,
25using mode
26.Li rwxrwxrwx (\&0777)
27as modified by the current
28.Xr umask  2  .
29.Pp
30The options are as follows:
31.Pp
32.Bl -tag -width indent
33.It Fl m
34Set the file permission bits of the final created directory to
35the specified mode.
36The mode argument can be in any of the formats specified to the
37.Xr chmod 1
38command.
39If a symbolic mode is specified, the operation characters
40.Dq +
41and
42.Dq -
43are interpreted relative to an initial mode of
44.Dq a=rwx .
45.It Fl p
46Create intermediate directories as required.
47If this option is not specified, the full path prefix of each
48operand must already exist.
49Intermediate directories are created with permission bits of
50.Li rwxrwxrwx (\&0777)
51as modified by the current umask, plus write and search
52permission for the owner.
53.El
54.Pp
55The user must have write permission in the parent directory.
56.Pp
57.Nm Mkdir
58exits 0 if successful, and >0 if an error occurred.
59.Sh SEE ALSO
60.Xr rmdir 1
61.Sh STANDARDS
62The
63.Nm mkdir
64utility is expected to be
65.St -p1003.2
66compatible.
67