Linux mkdir Command
The mkdir command in Linux is used to create directories. Below is a list of commonly used options with their descriptions:
| Option | Description |
|---|---|
-p |
Create parent directories as needed. If the parent directory does not exist, it will be created. |
-v |
Display a message for each created directory. |
--mode=MODE |
Set the file permissions for the new directory. |
--help |
Display help information about the mkdir command. |
--version |
Display the version of the mkdir command. |
Examples
mkdir new_folder- Creates a directory namednew_folder.mkdir -p parent/child- Creates a directory structure withparentandchild.mkdir -v new_folder- Creates a directory and displays a message.mkdir -m 755 new_folder- Creates a directory with specific permissions.