Thursday, August 16, 2007

Unix - `mkdir`

Unix command.

`mkdir` - make directories
Create the DIRECTORY(ies), if they do not already exist.

Usage:
mkdir [-m mode] [-p] dirname ...

OPTIONS:
The following options are supported:
-m --mode This option allows users to specify the mode to be used for new directories. Choices for modes can be found in chmod(1).
-p --parents With this option, mkdir creates dir by creating all the non-existing parent directories first. The mode given to intermediate directories will be the difference between 777 and the bits set in the file mode creation mask. The difference, however, must be at least 300 (write and executepermission for the user).
-v --verbose print a message for each created directory


EXAMPLES:
The following example:

1--------
[root@server tmp]# mkdir -m777 xxx
[root@server tmp]# ls -l
drwxrwxrwx 2 root root 4096 Feb 8 14:15 xxx

2--------
[root@server root]# mkdir -p /tmp/source/test
creates the subdirectory structure /tmp/source/test.

3--------
[root@ims tmp]# mkdir -v xxx
mkdir: created directory `xxx'



No comments: