Create new directory linux
To create a new directory in Linux, you can use the mkdir
command. Here's how:
- Open a terminal or command prompt.
- Type the following command, replacing "newdir" with the name you want to give your new directory:
mkdir newdir
- Press Enter to execute the command.
The mkdir
command will create a new directory with the specified name. If you want to create a directory with a specific path, you can specify the path along with the directory name. For example:
mkdir /path/to/newdir
This will create a new directory named "newdir" in the specified path.
You can also use the -p
option with mkdir
to create the directory and any parent directories that don't already exist. For example:
mkdir -p /path/to/newdir/subdir
This will create the directory "newdir" and its subdirectory "subdir" in the specified path, even if the parent directories don't already exist.
Note: If you want to create a directory with a specific permissions, you can use the -m
option with mkdir
. For example:
mkdir -m 755 newdir
This will create the directory "newdir" with the specified permissions (in this case, 755
, which means the owner has read, write, and execute permissions, the group has read and execute permissions, and others have read and execute permissions).