Home > Article > Operation and Maintenance > 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.
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:
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.
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.
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:
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.
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!