Creating a directory
mkdir pathname
mkdir projecta
The
default mode (read-write-execute permissions) for a directory created
with mkdir is: - owner=rwx
- group=rwx
- other=rwx
The new directory, projecta, is one level below her working directory. Figure 1 shows this relationship. If you do not specify an absolute path name for the directory to be created, the shell creates the new directory as a subdirectory of whatever your working directory is at the time you enter the command.
If you want to create a new directory that is not under your working directory, specify an absolute path name. Both directory names and file names can be up to 255 characters long. You may want to adopt some naming convention that allows you to distinguish between directory names and file names.
Your business may have adopted naming conventions for directories. For example, a typical convention is for each user to be assigned a directory based uniquely on the TSO/E user ID to make the name unique. Only that user would have write access to the directory. For information on how to change access permissions for a directory or file so that other users can read or write to it, see Handling security for your files.
MKDIR 'directory_name' MODE(directory_permission_bits)
- owner = rwx
- group = r-x
- other = r-x
The octal representation of these permissions is 755. (When MKDIR is used to create a directory, the default permission bits are different from when mkdir is used.) Here execute permission means permission to search the directory.
MKDIR '/u/smitha/umods' MODE(7,0,0)
MKDIR 'umods'
The directory umods is
one level below her home directory, smitha. Its full path name
is /u/smitha/umods.