Home > Article > Operation and Maintenance > How to create files in a directory in linux
Linux method of creating files in a directory: First open the xshell software to connect to the Linux server; then use [mkdir directory name] to create a directory and cd to the directory; then enter the command [touch file name] to create an empty file ; Finally, use [vim file name] to create an empty file and open it for editing.
Recommended: "linux tutorial"
linux creates files in the directory
Linux has several ways to create files. Today I will demonstrate how Linux creates files in a directory.
Method/Step
Open the xshell software and connect to the linux server.
Use [mkdir directory name] to create a directory and cd to the directory.
#Enter the command [touch file name] to create an empty file.
Use [vim file name] to create an empty file and open it for editing.
Enter [ls -l] to view the files in the current directory, and you can see the file you just created.
Notes
touch creates an empty file with nothing in it.
The above is the detailed content of How to create files in a directory in linux. For more information, please follow other related articles on the PHP Chinese website!