This instruction is aimed primarily at novice Ubuntu users. Those who have just started using the distribution may have noticed that it is not quite convenient to store all personal files in a common folder. Standard folders for these needs can simply begin to be insufficient.
In addition, the need for a new folder may arise because temporary files or entire programs have appeared. In general, there are many situations. There are several ways to create a new folder in Linux. Let's look at them in detail below.
In Ubuntu, as in other Linux-based operating systems, a folder (or directory) is a container for storing files and other folders. Folders help organize data, making it easier to navigate and manage files. Next, let's look at the main points about folders in Ubuntu.
Ubuntu uses a hierarchical file system structure where all files and folders are located in a single root directory, denoted by the /
symbol.
- ls
: displays the contents of the current directory.
- cd
: allows you to navigate between folders.
- mkdir
: creates a new folder.
- rmdir
: deletes an empty folder.
- rm -r
: deletes a folder and all its contents.
Each folder has permissions that determine who can read, write, or execute files in that folder. These permissions can be modified using the chmod and chown commands.
Ubuntu also has graphical file managers (such as Nautilus) that allow you to manage folders and files using an interface similar to Windows Explorer.
To get started, open a file manager called Nautilus. To do this, click on the shortcut on the Unity panel or in the Dash menu:
Next, go to the directory where we need to create a new folder:
We can create a new folder in the context menu. Click on an empty area of the screen and select "New Folder":
Now just specify a name for our folder. The name can contain any letters and numbers, as well as symbols, except for the slash. This is where Linux compares favorably to Windows - you have the option of assigning absolutely any name you can think of:
To save your changes, click once again on the empty area of the screen.
The terminal is too complicated in the eyes of newcomers. Therefore, it is often avoided to solve various difficulties. But you will have to start working with it sooner or later. Therefore, the method of creating a folder through the terminal is more suitable than ever for familiarization. The process is reduced to working with the mkdir
utility. All it can do is create folders. Let's consider its syntax:
$ mkdir [options] folder_name
There are not many options in this utility, most often you will pass it only one parameter - the name of the folder. So, open the terminal(Ctrl+Alt+T
) and type the following command:
$ mkdir folder
This will specify a new folder in the directory with the specified name. If the task is to create a folder in another directory, then specify the path to it:
$ mkdir Downloads/folder
This is how we created a new folder in a subfolder called Downloads. It is also realistic to use not only the path relative to the current folder, but also to specify the full path in the file system:
$ mkdir ~/Downloads/folder
This is the end of the instructions, but let's still consider the difference between the terminal and graphical programs.
We can create several folders at once using the command:
$ mkdir {folder1,folder2,folder3}
For example, the task is to create an Ubuntu folder, and in it several other folders, we will need to execute:
$ mkdir -p ~/Downloads/folder/folder/folder/folder
More complex structure:
$ mkdir -p ~/Downloads/folder/{folder1,folder2,folder3}
Now the instruction can be considered complete and finalized. Take advantage of the unique features that the terminal provides to the user.