LinuxQuestions.org
Help answer threads with 0 replies.
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 12-07-2004, 09:54 AM   #1
Godsmacker777
Member
 
Registered: Oct 2004
Posts: 52

Rep: Reputation: 15
output to a file - cat? grep?


I'd like to have the output of one file, just text, add a line to another text file. I know it's fairly simple, but I can't seem to find the info on it.

I run gentoo, and have all of my use flags stored in a text file, use.flags and I would like the lines added to the bottom of make.conf

Thanks~
 
Old 12-07-2004, 10:05 AM   #2
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
cat use.flags >> make.conf
 
Old 12-07-2004, 10:08 AM   #3
Godsmacker777
Member
 
Registered: Oct 2004
Posts: 52

Original Poster
Rep: Reputation: 15
great! thanks~
 
Old 12-07-2004, 10:09 AM   #4
jeffreybluml
Member
 
Registered: Mar 2004
Location: Minnesota
Distribution: Fedora Core 1, Mandrake 10
Posts: 405

Rep: Reputation: 30
wow, so the double >> makes it append to the end of an already existent file?

If so, that's a handy one to know!!

Thanks!!
 
Old 12-07-2004, 12:10 PM   #5
Godsmacker777
Member
 
Registered: Oct 2004
Posts: 52

Original Poster
Rep: Reputation: 15
yep!

handy eh.

here are a couple others:

echo "net-www/mozilla-firefox ~x86" >> /etc/portage/package.keywords

grep -i 'xorg' /etc/portage/* >> ./xorg_results
 
Old 12-07-2004, 12:36 PM   #6
kpex
Member
 
Registered: Apr 2004
Distribution: Slackware -current, Gentoo, FC3
Posts: 41

Rep: Reputation: 15
Quote:
Originally posted by jeffreybluml
wow, so the double >> makes it append to the end of an already existent file?
Yup.
 
Old 12-08-2004, 10:06 AM   #7
secesh
Senior Member
 
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
just be careful...

useing only one >
will OVERWRITE rather than APPEND
 
  


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
bash: how to edit cat <filename> | grep <keyword> feature? sirpelidor Linux - Software 2 06-20-2005 02:00 PM
logrotate log files - keeping in order when using grep or cat and bash dmellem Linux - Software 6 02-11-2005 01:05 PM
Cat input output error zaicheke Slackware 15 12-26-2004 09:08 PM
sort grep output wijnands Linux - Newbie 4 10-09-2004 07:14 AM
cat: output specific number of lines mikeshn Linux - Software 3 12-31-2003 12:15 PM


All times are GMT -5. The time now is 08:22 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration