How do I write to a text file in Linux?

Hương Trang

New member
How do I write to a text file in Linux?
Answer
To create a new file, use the cat command followed by the redirection operator ( > ) and the name of the file you want to create. Press Enter , type the text and once you are done, press the CRTL+D to save the file. If a file named file1. txt is present, it will be overwritten.
 

Tìm kiếm

Back
Top