Detailed explanation of mkdir command in Linux learning

Detailed explanation of mkdir command in Linux learning

Preface

I have become more and more interested in Linux in recent days.

The desire to see Tuckers again became stronger and stronger.

Ever since it left me 110110110 , we have had no contact.

Until now I am still confused.

I can't find it and I don't have any contact information.

But the fire in my heart has been ignited.

I started studying again under the moonlight.

1. Basic knowledge of file concepts

The above commands are all operations on files or folders.

So here comes the question:

Linux是先有文件還是先有文件夾(目錄)?
First, let’s take a look文件與文件夾的區別是什么?
File : A collection of information stored on a computer using its hard drive. Files can be text documents, pictures, programs, etc. The format is filename.extension , where the extension is used to indicate the file type.
Folder : A data structure used to organize and manage disk files. It helps people manage computer files. Each folder corresponds to a disk space. It provides an address pointing to the corresponding space and has no extension.
Directory : The mapping relationship between the file name and the physical location of the file. The index of this file is called a file directory.
The method to determine the file location is: absolute path directory + file name

insert image description here

insert image description here

To sum it up simply, files are those with extensions.

Folders are those without extensions.

The directory is the information in the address bar.

But please note that in Windows system, you may not check the option to view file extensions.

The extension name will not be displayed.

insert image description here
Some Linux files also do not have suffixes. I will explain them later when I encounter them.

OK, now that you know the basics,

So, Linux是先有文件還是先有文件夾(目錄)? What is the answer to the question?

Interested students can find the answer by themselves~

2. mkdir Command

Through the above understanding,

We know that it is impossible for any system to put all files in one folder (directory).

So how do we manage Linux files?

The first thing to do is to create a folder.

Storing your own files in categories also makes it easier to find them later.

mkdir ( make directory ) is used to create a directory.

Parameters Full Parameter Description -p–parents Recursively create multiple directories -m–mode=MODE Set directory permissions while creating the directory -v–verbose Display the directory creation process -Z Set the security context

mkdir folder name

You can see that you can create folders directly, but you cannot create multiple levels.

The default permissions are 777 minus the mask

insert image description here

mkdir -p multi-level directory

If there are multiple levels of folders that need to be created, this is a good and fast way to do it.

insert image description here

mkdir -m 755 folder name

What should I do if I want to grant corresponding permissions to the created folder?

This parameter makes you want to stop.

insert image description here

mkdir -v folder name

Just output what folders were created. Love should be expressed out loud.

insert image description here

mkdir -Z folder name

Set the security context, which is effective when SELinux is used;

Currently there is no difference from normal creation.

insert image description here

This is the end of this article about the detailed explanation of the mkdir command in Linux learning. For more relevant Linux mkdir command content, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed explanation of mkdir command in Linux
  • Detailed explanation of the commonly used Linux command mkdir
  • Detailed explanation of linux mkdir command
  • Detailed explanation of the use of mkdir command in Linux

<<:  Slot arrangement and usage analysis in Vue

>>:  Several implementation methods of the tab bar (recommended)

Recommend

Detailed explanation of component development of Vue drop-down menu

This article example shares the specific code for...

Proxy realizes the principle of two-way binding of Vue3 data

Table of contents 1. Advantages of proxy vs. Obje...

MySQL 8.0.12 Simple Installation Tutorial

This article shares the installation tutorial of ...

Getting Started with MySQL - Concepts

1. What is it? MySQL is the most popular relation...

Solution to the problem of saving format in HTML TextArea

The format of textarea can be saved to the databas...

WeChat applet realizes the effect of swiping left to delete list items

This article shares the specific code for WeChat ...

Docker Swarm from deployment to basic operations

About Docker Swarm Docker Swarm consists of two p...

MySQL installation tutorial under Linux centos7 environment

Detailed introduction to the steps of installing ...

VMware Tools installation and configuration tutorial for Ubuntu 18.04

This article records the installation and configu...

Several scenarios for using the Nginx Rewrite module

Application scenario 1: Domain name-based redirec...

Analysis and solution of Chinese garbled characters in HTML hyperlinks

A hyperlink URL in Vm needs to be concatenated wit...