main logo

How to Create Files in CentOS?

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:

CentOS

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.

Conclusion:
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?

Rakshitha
Rakshitha
Rakshitha a cloud hosting expert who helps businesses get the most out of their cloud services. She has experience setting up and managing cloud environments to improve performance and scalability. With her cloud certification, Rakshitha provides clear advice on how to use cloud solutions effectively for better business results.
Share
Contents

Related Articles

medhacloud logo
USA:
Medha Cloud Solutions LLC
30 N Gould St Ste R, Sheridan, WY 82801,
Phone: +1 646 775 2855

India:
Medha Cloud Solutions Private Limited
#74, 7th Cross, Krishna Garden InCity Layout. Chikka Kammanahalli, Banneraghatta Road, Bangalore 560083
Phone:+91 93536 44646

E-Mail: sales@medhahosting.com
©Medha Cloud 2024. All rights reserved.