Edit Text Files Using Cat Command
This command is mainly used to see what is written in a text file, but it can also be used to create and edit text files. The command to create the text file using the Cat Command is given below:
cat > test.txt
- Once you execute the above command ,you will be see a cursor waiting for you to enter any text you wish to add or in simple words you can edit the newly created text file.
- After you are done with editing the text file , press CTRL + D to exit.
Note : If you want to check if the file is created , you may run the command as – ls -l .
- To preview the text file that you have just created , you may run the command given below:
cat test.txt
How to Edit Text Files in Linux?
Like any other OS, creating and editing Text files is an important skill to be known to any user. In this article, we will learn how to easily create and edit Text files in Linux using simple and basic terminal commands such as cat, touch, nano, vi, and standard redirect symbol.
Table of Content
- What is Text File in Linux?
- How to Open Text Files in Linux?
- How to Edit Text Files in Linux?