main logo

How to create Files in CentOS?

Share
Try Medha Cloud for free
Click below to sign up and get $200 of credit to try our products over 60 days!
Contents
Rakshitha
Rakshitha is 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, Rakshithe provides clear advice on how to use cloud solutions effectively for better business results.

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?

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 Hosting Private Limited
#74, 7 Th Cross, Krishna Garden InCity Layout. Chikka Kammanahalli, Banneraghatta Road, Bangalore 560083
Phone:+91 93536 44646

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