Create a new folder on linux
To create a new folder on Linux, you can use the mkdir
command. Here's how:
-
Open a terminal window.
-
Navigate to the directory where you want to create the new folder using the
cd
command. For example:cd /path/to/directory
Replace
/path/to/directory
with the actual path to the directory where you want to create the new folder. -
Use the
mkdir
command to create the new folder. For example:mkdir mynewfolder
Replace
mynewfolder
with the name you want to give to the new folder. -
Press Enter to create the folder.
You can also use the -p
option with mkdir
to create the folder and any parent directories that don't already exist. For example:
mkdir -p /path/to/new/folder
This will create the /path/to/new/folder
directory and any parent directories that don't already exist.
Alternatively, you can use the mkdir
command with the --parents
option to achieve the same result. For example:
mkdir --parents /path/to/new/folder
Note that the --parents
option is available in some Linux distributions, but not all. The -p
option is more widely supported.