LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-03-2005, 12:24 AM   #1
minm
Member
 
Registered: Jun 2003
Location: Canada
Distribution: suse 9.2
Posts: 582

Rep: Reputation: 30
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.
 
Old 07-03-2005, 01:04 AM   #2
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
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...
 
Old 07-03-2005, 01:06 AM   #3
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
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.
 
Old 07-03-2005, 01:16 AM   #4
Michael Johnson
Member
 
Registered: Jul 2005
Location: Wagga Wagga, Australia
Posts: 262

Rep: Reputation: 30
Very good and you can do this to append to an existing file
cat >>filename.txt
 
Old 07-03-2005, 01:29 AM   #5
kencaz
Senior Member
 
Registered: Mar 2005
Location: Las Vegas, NV
Distribution: Mandriva Slackware FreeBSD
Posts: 1,468

Rep: Reputation: 48
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
 
Old 07-03-2005, 01:32 AM   #6
minm
Member
 
Registered: Jun 2003
Location: Canada
Distribution: suse 9.2
Posts: 582

Original Poster
Rep: Reputation: 30
thanks guys
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command to select and move mutiple files from list in text file steve.paris Linux - Newbie 11 11-27-2005 01:44 PM
how to cat a text file and save it as a variable mrobertson Programming 37 07-05-2005 09:20 AM
Command line tools to Find files with specific text naps Linux - Software 5 11-15-2004 05:46 AM
cat command juanb Linux - Newbie 4 08-19-2004 12:14 PM
Edited a text using CAT, Wreck-It Linux - Software 2 09-24-2003 06:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration