In this post we will see how to create Files using terminal commands in CentOS. CentOS is a Community Enterprise operating system which mainly focuses on the server. It is a part of Linux Operating System Distribution and it is free to use. First open the terminal
Total Time Needed: 30 Minutes
Step 1 : Create a Single File
The Command used to create a Single Directory is touch. Enter the command touch along with Directory name. For example, to create a directory file1 enter the command touch file1.
Check if the file is created - Enter the command ls and press Enter. You can see that file1 is created
Step 2 : Create Multiple Files
Use the same command touch as above and type all the names of files to be created. For example, to create directories file2, file3, file4. Type touch file2 file3 file4 and press enter.
Check if the files are created- Type the command ls and press Enter. You can see that file2, file3, file4 are created
Step 3: Create a File at a Particular Location
To create a file in a particular location, type the command touch, and the path to the location. For example, to create a file.txt in Desktop, the path to the Desktop is /root/Desktop. Type touch /root/Desktop/ file.txt.
Hope you understand how to create files in CentOS.Follow these steps and create files in CentOS. If you need any help regarding Linux and support on your Linux infrastructure please contact Medha Hosting.
Read Here: How to Create Directories in CentOS?