How do you create a file with content in Unix?

Đức Linh

New member
How do you create a file with content in Unix?
Answer
How to create a file in Linux from terminal window?
  1. Create an empty text file named foo.txt: touch foo.bar. …
  2. Make a text file on Linux: cat > filename.txt.
  3. Add data and press CTRL + D to save the filename.txt when using cat on Linux.
  4. Run shell command: echo ‘This is a test’ > data.txt.
  5. Append text to existing file in Linux:
 

Tìm kiếm

Back
Top