Text files can be viewed and edited using any text editor that exists in Linux. However, before learning the editing part, we must have a basic understanding of different ways that can be used to create plain text files. Depending on the requirement, different methods can be used for text file creation. The most popular ones are described next.
Different methods to create a text file
Create a text file using the cat command
The cat command can be used to create a text file if we immediately want to add some text to a new blank file. The syntax of the cat command to create a file is as follows:
$ cat > demo.txt
After pressing Enter, we will return to the prompt and we can directly start inserting text into our file. Once...