Medha Cloud Logo

How to create Files in CentOS?

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

Required Tools:


Steps to create Files in CentOS

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?

Connect with Medha Cloud

Microsoft 365 Migration Form

I would like to send my contact information to MedhaCloud so that MedhaCloud can share additional information about products, services, thought leadership and invitations to flagship events with me by email. *

By submitting this form, I acknowledge that someone from MedhaCloud will contact me via email or phone to discuss my request.

Related Article

View All
chevron-down linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram