write texts in terminal with cat

Miscellaneous tools
Post Reply
Message
Author
labbe5
Posts: 2159
Joined: Wed 13 Nov 2013, 14:26
Location: Canada

write texts in terminal with cat

#1 Post by labbe5 »

One way to write a short text in terminal, instead of using a proper text editor, such as Libre Office or Abiword, is :

$ or #cat> filename.txt
enter
write your text
then close it with :
ctrl + D
It will be saved in directory where you opened a terminal window.

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#2 Post by amigo »

You can also use 'echo' and with either echo or cat use shell redirection to append to a file. With newer bash you can even insert text at a certain point using 'read' (IIRC).

Post Reply