Linux Hint Posted April 8 Share Posted April 8 Directories, or folders, are organizational structures that help you organize your data and keep your Linux systems clean. They also streamline collaboration with other users on the same system. Hence, directories become the most essential yet basic aspect for managing your systems efficiently. Creating and removing directories is a core operation, even for system administrators. However, many Linux newbies don’t know how to create new directories correctly. So, this quick tutorial explains the simple ways to create a directory in Linux. You can easily create the directories through the mkdir and File Manager. Let’s briefly take a look at both methods with suitable examples. The mkdir Command The sole operation of the mkdir is to create a directory, and you can use it by running the following command: mkdir <options> directory_name For instance, let’s create the media directory: mkdir media As you run the above command, it’ll create the media directory, and you can verify it using the ls command: ls In case you want to print the output of the command, then you can use the -v option: Mkdir -v linux Moreover, if you want to create multiple directories, then all you need to do is add the name of those directories in the mkdir command: mkdir -v windows android mac You can also make a nested directory by using the -p option with the mkdir command: mkdir -p parent_directory/sub_directory Please replace parent_directory and sub_directory accordingly before running the command. So, let’s create the nested directory by including multiple files as the subdirectories: mkdir -p Linux_OS/Ubuntu/Files You can also verify the directory using the tree command: cd ~/Linux_OS tree The File Manager Apart from using the terminal, you can opt for the File Manager to create a directory in Linux. Linux distros come with an inbuilt file manager like Nautilus. For this method, go through the following steps: Open the File Manager and navigate to the path where you want to create the new directory. Now, right-click and then select “New Folder” from the Options menu. In some cases, the option may show as “Create Folder.” Finally, enter your directory’s name and press Enter. Wrapping Up Creating directories in Linux is the most basic task, but many beginners still need to learn how to create one. This quick tutorial focussed on providing a step-by-step method for creating a directory using the mkdir command and the File Manager. We’d recommend using the mkdir command to build familiarity with the terminal. View the full article Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.