Mkdir command in linux

Mkdir Command in Linux

Introduction

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.

The syntax of mkdir command

$ mkdir [options] name

For example, I will create a directory named linuxer:

$ mkdir linuxer
Sponsored

Output:

Mkdir command in linux 1

options

–version check your version

$ mkdir --version

Output:

See also  Canonical collaborates with NVIDIA to simplify enterprise AI deployments with NVIDIA BlueField-3 operating an optimised, Ubuntu-based Linux OS 

Mkdir command in linux 2

–help display help information

$ mkdir --help

Output:

Mkdir command in linux 3

-v show folder creation process

Sponsored
$ mkdir -v [name]

Output:

Mkdir command in linux 4

-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:

Mkdir command in linux 5

-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

Conclusion

In this tutorial, we guided you on how to use the mkdir command with some examples.

See also  Ptyxis – New Container-Focused Terminal Emulator for GNOME

Thanks for reading!

Karim buzdar

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.


Discover more from Ubuntu-Server.com

Subscribe to get the latest posts sent to your email.

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply