Quick Answer: How to Create Text File in Linux?
Contents Part 2 Creating a Quick Text File Type Cat > Filename. Txt into Terminal. You’ll Replace “Filename” with Your Preferred Text File Name (E. G...
Contents
Part 2 Creating a Quick Text File
- Type cat > filename.txt into Terminal. You’ll replace “filename” with your preferred text file name (e.g., “sample”).
- Press ↵ Enter .
- Enter your document’s text.
- Press Ctrl + Z .
- Type ls -l filename.txt into Terminal.
- Press ↵ Enter .
How do you create a text file?
Another way to create a text file is to right-click on your desktop screen and in the menu that appears, click New and then click Text Document. Creating a text file this way opens your default text editor with a blank text file on your desktop. You can change the name of the file to anything you want.
Must Read
How do you create a text file in Unix?
There are multiple ways to create a file in unix.
- touch command: It will create an empty file in directory specified.
- vi command (or nano): You can use any editor to create a file.
- cat command: Although cat is used to view file, but you can use this to create file as well from terminal.