To create a directory in Linux, you can use the mkdir
command followed by the name of the directory you want to create. For example:
mkdir new_directory
This will create a new directory called new_directory
in the current working directory.
You can also use the -p
option to create a directory and any necessary parent directories in a single command. For example:
mkdir -p path/to/new_directory
This will create a new directory called new_directory
in the path/to
directory, as well as any other parent directories that do not already exist.
You can also use the -m
option to specify the permissions for the new directory. For example:
mkdir -m 755 new_directory
This will create a new directory called new_directory
with permissions set to 755
, which allows read, write, and execute permissions for the owner and read and execute permissions for everyone else.
For more information, you can consult the mkdir
man page by running man mkdir
on the command line.