In Ubuntu, you’ve probably come across the process of managing files and directories. One of the basic tasks in this process is the creation of folders and new directories. This puts your administrative tasks in order and makes using the server much easier. This article will describe several ways to create folders and also the actual commands/steps to follow.
Method #1. Using the mkdir command
The most common and easiest way to create a new directory in Linux is to use the mkdir (make directory) command.
mkdir example_forder
For example, to create a folder named “YourNewFolder“, enter:
mkdir YourNewFolder
Method #2. Specifying the full path
You can also specify the full path to create a folder in a specific location. For example:
mkdir /path/to/YourNew/Folder
Where “/path/to/YourNew/Folder” is the full path to the new folder.
Method #3. Creating subfolders
The mkdir command can also be used to create subfolders. If you want to create a folder inside another folder, use the -p option:
mkdir -p parent_folder/Your_New_Folder
This command will create both the parent folder and a new folder within it.
Method #4. Creating multiple folders at once
To create multiple folders at once, you can list them separated by a space after the mkdir command:
mkdir FirstFolder SecondFolder ThirdFolder
This will create three folders: “FirstFolder“, “SecondFolder” and “ThirdFolder“.