In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use the mkdir command to create directories and subdirectories under Linux. It is very detailed and has a certain reference value. Interested friends must finish reading it!
What is mkdir?
Mkdir is a command used to create a directory on a Linux system. This command is a built-in command.
Run the mkdir command
You can use it by typing mkdir directly in your console.
$mkdir
By default, running the mkdir command without any parameters creates a directory under the current directory. The following is a reference example:
As you can see from the figure above, we have created a directory called office. When we run the mkdir command, we are in the / home/pungki directory. So the new directory office is created in the / home/pungki directory. If we use an absolute path-for example: / usr/local -, Linux creates a directory under the / usr/local directory.
When Linux discovers that the directory you want to create already exists, Linux prompts us that Linux cannot create it.
Another first condition for creating a directory is that you must have access to the destination path where you want to create the directory. Mkdir will report this error when you cannot get permission.
Create multiple directories
We can also create multiple directories at the same time. For example, the directories we are going to create are ubuntu, redhat and slackware. Then the grammar would look like this:
$mkdir ubuntu redhat slackware
Add a directory containing subdirectories [translation note: recursively create a directory]
You need to use the-p parameter when the directory you want to create contains subdirectories. If mkdir cannot find the parent directory, this parameter will first help create the parent directory. For example, we want to create a directory called letter, which contains a subdirectory important. Then the grammar would look like this:
$mkdir-p letter/important
Set access permissions
Using the-m parameter, we can set permissions for the new directory to be generated. Examples are as follows:
$mkdir-masking r Murray-letter
The above command creates a directory called letter and gives read-only permissions to directory owners, user groups, and other users
Print process information for creating a directory
If we want to view the information, we can use the-v parameter to do so. Examples are as follows:
$mkdir-v ubuntu redhat slackware
The above is all the contents of the article "how to use the mkdir command to create directories and subdirectories under Linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.