Link copied to clipboard!
Linux & Hosting

How to Create Files in CentOS?

Rakshitha
Rakshitha
White-Label Services Specialist
Jul 29, 20202 min read
24
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.
How To Create Files In Centos 1
Check if the file is created – Enter the command ls and press Enter. You can see that file1 is created
How To Create Files In Centos 2
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.
How To Create Files In Centos 3
Check if the files are created- Type the command ls and press Enter. You can see that file2, file3, file4 are created
How To Create Files In Centos 4
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.
How To Create Files In Centos 5
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?

Topics

CentOSfile creationVPS hosting
Rakshitha
Written by

Rakshitha

White-Label Services Specialist5+ years

Rakshitha specializes in white-label IT services and Linux server administration. She helps MSPs expand their service offerings through strategic outsourcing partnerships and provides expert guidance on Linux-based infrastructure solutions.

White-Label IT ServicesLinux AdministrationIT Outsourcing
Follow on LinkedIn

Need Expert Help?

Our team of cloud and IT experts is ready to help you solve your toughest challenges. Get personalized assistance today.