Command Reference Guide

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man1/!!!intro.1
________________________________________________________________
___ ___
m
mkdir(1) mkdir(1)
NAME
mkdir - make a directory
SYNOPSIS
mkdir [-p][-m mode ] dirname ...
DESCRIPTION
mkdir creates specified directories in mode 0777 (possibly altered by umask unless specified otherwise by
a -m mode option (see umask(1)). Standard entries, . (for the directory itself) and .. (for its parent) are
created automatically. If dirname already exists, mkdir exits with a diagnostic message, and the direc-
tory is not changed.
Options
mkdir recognizes the following command-line options:
-m mode After creating the directory as specified, the file permissions are set to mode, which is a
symbolic mode string as defined for chmod (see chmod(1)). The umask(1) has pre-
cedence over -m.
-p Intermediate directories are created as necessary. Otherwise, the full path prefix of dir-
name must already exist.
mkdir requires write permission in the parent directory.
For each directory name in the pathname prefix of the dirname argument that is not the
name of an existing directory, the specified directory is created using the current
umask
setting, except that the equivalent of chmod u+wx is done on each component to
ensure that mkdir can create lower directories regardless of the setting of umask.
Each directory name in the pathname prefix of the dirname argument that matches an
existing directory is ignored without error. If an intermediate path component exists,
but has permissions set to prevent writing or searching,
mkdir fails with an error mes-
sage.
If the -m option is used, the directory specified by dirname (excluding directories in the
pathname prefix) is created with the permissions specified by mode.
Only
LINK_MAX subdirectories can be created (see limits(5)).
Access Control Lists - JFS File Systems Only
If the parent directory has an access control list (ACL, see aclv(5)), and that ACL contains default entries,
an ACL is created for the new directory, and the parent directory’s default entries are applied to the new
directory’s ACL, both as regular entries and as default entries.
EXTERNAL INFLUENCES
Environment Variables
LANG provides a default value for the internationalization variables that are unset or null. If LANG is
unset or null, the default value of "C" (see lang(5)) is used. If any of the internationalization variables con-
tains an invalid setting, mkdir will behave as if all internationalization variables are set to "C". See
environ(5).
LC_ALL If set to a non-empty string value, overrides the values of all the other internationalization vari-
ables.
LC_CTYPE determines the interpretation of text as single and/or multi-byte characters, the classification
of characters as printable, and the characters matched by character class expressions in regular expres-
sions.
LC_MESSAGES determines the locale that should be used to affect the format and contents of diagnostic
messages written to standard error and informative messages written to standard output.
NLSPATH determines the location of message catalogues for the processing of LC_MESSAGES.
International Code Set Support
Single- and multi-byte character code sets are supported.
DIAGNOSTICS
mkdir returns exit code 0 if all directories were created successfully. Otherwise, it prints a diagnostic and
returns non-zero.
HP-UX Release 11i: December 2000 1 Section 1529
___
___