To create a file using your terminal, use the
touch command is used to create files in the terminal. If the file you are trying to create already exists in the folder you are in, it simply updates the modification and access time of the file.
To create a file named
index.html, enter the following command in your terminal:
To check that the file was created, enter the following command to print out the contents of your current folder:
You should see the file listed in the output along with any other files and folders inside the current directory.
Create multiple files
To create multiple folders, pass in multiple folder names as arguments to the
touch command, like this:
touch index.html about.html
The above command will create files named
Try the following command in your project folder:
man touch command in your terminal to learn more.