In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to use the mkdir command in Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Linux mkdir command
As mentioned above, users can use the mkdir command to create directories. Its syntax is as follows:
Mkdir [OPTION]... DIRECTORY...
The following is a description of this tool in the man manual:
If the directory does not already exist, create it.
The following Quan An examples will help you better understand how the mkdir command works.
Q1. How do I create a directory using the mkdir command?
Creating a directory is very simple. All you need to do is follow the name of the directory you want to create after the mkdir command as an argument.
Mkdir [dir-name]
Here is a simple example:
Mkdir test-dirQ2. How do I ensure that a parent directory is created when the parent directory does not exist?
Sometimes we need to use a mkdir command to create a complete directory structure, in which case you only need to use the-p command line option.
For example, if you want to create a directory dir1/dir2/dir3, but the parent directory of that directory does not exist, you can do something like this:
Mkdir-p dir1/dir2/dir3
How to make sure parent directories (if non-existent) are created
Q3. How do I customize permissions when creating a directory?
By default, when the mkdir command creates a directory, the permissions are set to rwx, rwx, and rmurx.
How to set permissions for directory being created
However, if you want to customize permissions, you can use the command line option-m.
Mkdir-m command option
Q4. How do I make the mkdir command display operation details?
If you want the mkdir command to show full details of what it does, you can use the-v command line option.
Mkdir-v [dir]
Here is an example:
Thank you for reading! This is the end of this article on "how to use mkdir commands in Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
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.