LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cat command for text files (https://www.linuxquestions.org/questions/linux-newbie-8/cat-command-for-text-files-339494/)

minm 07-02-2005 11:24 PM

cat command for text files
 
hey all, i remember reading that there was a command with cat that allowed me to enter, which will let me type some text into a file and ends when i hit enter or esc.

Does anyone recall what the console command is?

Thanks.

cs-cam 07-03-2005 12:04 AM

There is, I was following instructions the other day that had me use it. Can't remember what it was though :( I'll hunt around my history see if I can find it...

cs-cam 07-03-2005 12:06 AM

Okay, it's actually simple I figured it out playing in the console trying to remember:
Code:

cat >filename.txt
Then you'll be able to type stuff in, easy :) Ctrl-D to dump input to file and exit.

Michael Johnson 07-03-2005 12:16 AM

Very good and you can do this to append to an existing file
cat >>filename.txt

kencaz 07-03-2005 12:29 AM

Another variation on the cat command to write text files.

cat > filename.txt << end

This capture all input until the word "end" is typed then automatically dump to "filename.txt"

KC

minm 07-03-2005 12:32 AM

thanks guys :)


All times are GMT -5. The time now is 11:34 AM.