mkdir command stands for make directory allows the user to create an empty directory on Linux operating system. This command can also create multiple folders at once as well as set permissions for folders. Of course, pay attention to the permission to create the user’s directory when standing in the parent directory or not? Otherwise, you will get an error message about permission denied.
And the article below, we will show you how to use the mkdir command through several examples as go through below.
$ mkdir [options] name
For example, I will create a directory named linuxer:
$ mkdir linuxer
Output:
options
–version check your version
$ mkdir --version
Output:
–help display help information
$ mkdir --help
Output:
-v show folder creation process
$ mkdir -v [name]
Output:
-p create a directory with parent directory level
$ mkdir -p [name]
For example, I will create the linux1 directory inside the linux2 directory:
$ mkdir -p -v linux1/linux2
Output:
-m create folders with specific permissions
$ mkdir -m [permission_value] name
For example, I want to create a directory named best with all permission:
$ mkdir -m a=rwx best
In this tutorial, we guided you on how to use the mkdir command with some examples.
Thanks for reading!
Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.
The Linux terminal is a powerful tool allowing users to control their system precisely and…
Welcome to the Ubuntu Weekly Newsletter, Issue 876 for the week of January 19 –…
Canonical Ceph with IntelⓇ Quick Assist Technology (QAT) Photo by v2osk on Unsplash When storing…
Introduction Using Kafka for Remote Procedure Calls (RPC) might raise eyebrows among seasoned developers. At…
This article provides a guide for how to install PalWorld on Ubuntu VPS server. How…
Using APT to manage software on Ubuntu (or similar Linux systems) is generally simple. It…