Introduction
The Linux command mkdir is a command used to create a new directory. It stands for “make directory” and is used to create a new folder or directory in the current working directory. The mkdir command is a powerful tool that can be used to create multiple directories at once, as well as set permissions on the newly created directories. It is a very useful command for organizing files and folders on a Linux system.
Examples
The mkdir command in Linux is used to create a new directory.
Syntax:
mkdir [OPTION]… DIRECTORY…
Example:
mkdir my_new_directory
Mkdir Linux Command
The mkdir command is a Linux command used to create directories. It stands for “make directory” and is used to create a single or multiple directories and subdirectories. The mkdir command is one of the most basic and frequently used commands in Linux.
The syntax for the mkdir command is as follows:
mkdir [OPTION]... DIRECTORY...
The options for the mkdir command are as follows:
- -m : Sets the file mode (permissions) of the directory.
- -p : Creates any missing parent directories.
- -v : Verbose mode. Prints a message for each created directory.
The mkdir command is used to create a directory with the specified name. For example, to create a directory named “mydir”, the command would be:
mkdir mydir
To create multiple directories at once, the command would be:
mkdir dir1 dir2 dir3
To create a directory and set the file mode (permissions) of the directory, the command would be:
mkdir -m 755 mydir
To create a directory and its parent directories, the command would be:
mkdir -p mydir/subdir1/subdir2
The mkdir command is a powerful and useful command that can be used to create directories and subdirectories quickly and easily. It is an essential command for any Linux user.