mkdir Command Options For Linux and Windows

RSS
FACEBOOK
FACEBOOK
PINTEREST
PINTEREST
LINKEDIN
INSTAGRAM

mkdir command is used to create new folders and directories. mkdir have very little options but because of the mkdir command importance, we will examine these options.

Linux Options

There are more Linux options than Windows operating systems option. We will look these Linux options below.

Help Option

We can print help information about the mkdir command options. We will use --help  in order to print help information about options.

Help Option

Help Option

Set Folders and Directories Mode

We can use -m or --mode option in order to set permissions about folders and directories which will be created with the mkdir command. In this example, we will set rwx.

Parent Option

While creating folders and directories in a recursive fashion, if the parent is not currently existed we will get an error like cannot create directory ‘ismaail/baydan/backup’: No such file or directory. Because there is o directory like ismail and baydan . We can create with a single command multiple child and parent directories by using -p option. In this example, ismail and baydan will be created automatically and then backup directory will be created without a problem.

Verbose Option

During folder and directory creation there will be no information about process except errors. We can print operations about folder and directory creation with the -v option like below.

Verbose Option

Verbose Option

SELinux Option

SELinux is a security mechanism used to protect files and folders access via processes. We can set SELinux context by using --context option.

LEARN MORE  Linux Chmod Command Tutorial with Examples To Change Permission of Files and Folders

Windows Options

Windows operating system provides less option than Linux counterpart. We can only print usage information with the help information.

Help Option

We can print help information with the /? option like below.

Windows Help Option

Windows Help Option

RSS
FACEBOOK
FACEBOOK
PINTEREST
PINTEREST
LINKEDIN
INSTAGRAM

Leave a Reply

Your email address will not be published. Required fields are marked *

Enjoy this blog? Please spread the word :)