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

CentOS 6.5 installation mysql5.7 tutorial

1. New Features MySQL 5.7 is an exciting mileston...

Summary of Vue component basics

Component Basics 1 Component Reuse Components are...

Example code for implementing triangles and arrows through CSS borders

1. CSS Box Model The box includes: margin, border...

ftp remotely connect to Linux via SSH

First install ssh in Linux, taking centos as an e...

How to implement n-grid layout in CSS

Common application scenarios The interfaces of cu...

JavaScript message box example

Three types of message boxes can be created in Ja...

Javascript scope and closure details

Table of contents 1. Scope 2. Scope Chain 3. Lexi...

5 Easy Ways to Free Up Space on Ubuntu

Preface Most people will probably perform this op...

How to install MySQL 8.0 in Docker

Environment: MacOS_Cetalina_10.15.1, Mysql8.0.18,...

How to use Docker containers to implement proxy forwarding and data backup

Preface When we deploy applications to servers as...

Summarize several common ranking problems in MySQL

Preface: In some application scenarios, we often ...

Example of how to implement underline effects using Css and JS

This article mainly describes two kinds of underl...