Home  >  Article  >  Operation and Maintenance  >  How to create files and folders in linux

How to create files and folders in linux

王林
王林Original
2019-12-26 13:25:5622456browse

How to create files and folders in linux

First let’s talk about the touch command to create a file. Touch can be used to create binary files. The usage is very simple.

Usage: touch file name, there must be a space between touch and file name.

In the picture, we first use the command shared before to check how many files there are under the / directory and the names of the files.

How to create files and folders in linux

Here we will demonstrate the usage of touch. For example, if I want to create a binary file with the file name abc, then the formula in Linux should be written as # touch abc

Free video tutorial sharing: linux video tutorial

The specific operation is shown in the figure:

How to create files and folders in linux

After the creation is completed, use the ls command to view the file we created. You can see that the abc file pointed by the red arrow in the picture is the newly created file.

How to create files and folders in linux

I am talking about a command mkdir to create a folder. mkdir can create a folder and its usage is very simple.

Usage: mkdir folder name, there must be a space between mkdir and the file name.

In the picture, we first use the command shared before to check how many files there are under the / directory and the names of the files.

How to create files and folders in linux

Here we will demonstrate the usage of mkdir. For example, if I want to create a folder with the file name one, then the formula in Linux should be written as # mkdir one

The specific operation is shown in the figure:

How to create files and folders in linux

After the creation is completed, use the ls -l command to check it File properties, you can see that the folder pointed by the red arrow in the picture is newly created.

How to create files and folders in linux

Recommended related articles and tutorials: linux tutorial

The above is the detailed content of How to create files and folders in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn