In this tutorial, we will go through the mkdir command in Linux. Whether it’s for personal or for work, everyone loves to create directories in Linux to keep things organized in one place. Most people would start in just one folder to curate their files intended for personal purposes until they couldn’t stop themselves from creating one after another.
Well, who would hesitate to keep their desktops tidy and nice if generating folders is just as easy as two to three clicks?
However, sorting out a bunch of computer files is not always as therapeutic as it may seem. Uncommon operating systems such as Unix and Linux have another way of doing this in a different way.
Just like in Windows and macOS, you can create directories in Linux without any effort. The only difference is that you will use the command-line interface (in most cases) to make the folders. One of the most used Linux commands to accomplish this task is Linux mkdir.
Before discussing the mkdir command in Linux operating system, it’s important to know what exactly these two operating systems are [Unix and Linux]. Are they the same?
Every computer has its operating system, which makes them run and process various programs. The most common OS amongst the vast majority of people is Windows by Microsoft and macOS by Apple. But aside from these two systems, most of the internet is powered by Linux and Unix operating systems.
What is Linux?
Linux is widely known as an open-source operating system. Unlike Windows and macOS which require a sort of paid activation key, Linux has granted anyone access to its system for any purposes without any charge.
It has been named the most popular OS on earth despite Microsoft and Apple’s dominance in most computers today. In case you’re not aware, devices that have been a huge part of everyone’s daily lives, such as Android phones, high-tech cars, smart appliances, and company servers, are powered by Linux.
This operating system, unknown to many, hosts the world’s top supercomputers and even the stock exchange. Amazing, right?
By purchasing a linux vps, you can have full control over your hosting environment and tailor it to your specific needs, allowing you to optimize performance and ensure reliable uptime for your applications or website.
What is UNIX?
But right before Linux was born, there was another operating system that tried to change the world. Bell Labs Research introduced Unix in the 1970s as an OS for computers that run multi-user programs.
Back then, Unix was able to pave its way towards worldwide popularity for being the first compact operating system designed in C Programming Language. However, its fame started to fade away when Linux began to rise in 1994 as Unix’s free clone.
Difference Between Linux and UNIX
Linux and Unix have many similarities, so it’s no surprise that many people can’t still exactly differentiate the two up until today. But to mention a few differences, Linux is completely free while Unix provides access to copyright holders only. Unix is compatible with some computer files but lesser compared to what Linux can support.
When it comes to devising security, both of them almost provide the same level of cyber protection.
If you get used to Windows or macOS for a long time, navigating through Unix and Linux’s interfaces will surely bring you to an extremely different world. Simple tasks such as creating a folder for your files will suddenly become an unfriendly errand. Also adding more security for your Linux or UNIX operating system is different from windows and macOS, here you can read our guide on how to choose a secure password.
If such kind of easy tasks only takes you a few minutes to complete on your MacBook, Unix and Linux will ask more time than you expect. You have to go into your gadget’s user command and enter the mkdir command on the designated line. Does it sound foreign to you? It’s alright! Take it slowly and read through the step-by-step guide below.
What is Linux Mkdir Command?
In the simplest explanation, mkdir stands for ‘make directory’ and is a typical code used to create Linux directories on devices powered by Linux or Unix. If this seems unclear, the directory is the Unix and Linux counterpart for the macOS and Windows folders. It also has the purpose of storing, preserving, and protecting files installed on the computer.
However, directories are far different from folders when it comes to the files they curate. Directories are most often used for keeping sensitive and confidential data, including rosters of diverse file names as well as their equivalent inode numbers. There are quite a number of important directories in Linux.
Every inode number in the system represents a specific inode that holds all the relevant information about the file. It synchronizes all the computer data on the operating system.
Aside from generating directories for new loads of incoming files, the mkdir Linux command also allows the users to assign access and creation permission for each directory. Before a user can create directories to your computer using the mkdir command, he first needs to seek consent from the parent directory; otherwise, his attempt will be instantly denied.
Are you ready to create folders in Linux? Read below the listed step-by-step Linux mkdir command guide and run your fingers like a PRO.
A Complete Beginners Guide on Create Directory Linux [mkdir Command]
Here’s how you can create a brand new directory on your Linux or Unix device:
- The syntax you’re going to use in performing this command is:
mkdir [OPTION]... DIRECTORY...
- This is how the syntax should mean:
Generate the DIRECTORY(ies) if they don’t yet exist.
- Pass the name of the directory you’re about to generate with mkdir command. See the example below.
mkdir [dir-name]
mkdir test-dir
Note that the command comes with many options (mkdir options) and here we will cover the most basic ones!
How to mkdir multiple directories simultaneously? [mkdir multiple directories]
You can also create multiple directories on your device at once. Here’s how:
- Pass the file names of the directories you’re about to create with mkdir command. File names need to be separated by spaces. See the example below:
mkdir goo aar raz
Ls
Result:
goo aar raz
How to Check Complete Operations Performed by Linux mkdir
mkdir command can also show the complete details regarding the operations it’s about to perform. Here’s how:
- mkdir can disclose details about its operations using the option called v- line command.
mkdir -v [dir]
Final Thought
Whether it’s about creating a Linux directory, it’s always important to keep essential computer files in a safe and secure place. They are virtual assets, so losing them once would mean losing them forever. Use the listed guide above and take every pointer seriously while Creating directories using the mkdir command in Linux will then become as easy as creating folders on Windows and macOS.
People Are Also Reading: