LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-14-2002, 09:07 PM   #1
yuzuohong
Member
 
Registered: May 2002
Location: Shanghai, PRC
Distribution: RedHat 6.2 | 7.2 | 8 | 9|3
Posts: 81

Rep: Reputation: 15
Red face How can I catch some "KEY WORDS" from a text file without opening it?


Hi all,

How can I catch some "KEY WORDS" from a text file without opening it?
I mean -- We can use "ps -ef |grep named" to take out "named" lines from the output. Now, if I am interested with some "KEY WORDS" in a text file, how can I take out the line which contains the "KEY WORDS"?
Thank you very much.

fish
 
Old 06-14-2002, 09:27 PM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Code:
grep key filename
cat filename | grep key
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete text between key words : sed shalomajay Programming 7 05-11-2011 06:22 PM
Windows XP opening Samba file as "READ ONLY"? core_sa Red Hat 0 08-28-2004 01:55 PM
remove "special" text out of a file tearinox Linux - General 1 03-15-2004 08:43 PM
"how do I extract a number from a text file using shell command?" sdandeker Linux - Networking 3 02-12-2004 08:54 AM
Inputting a text file in to the "rm" command R4z0r Linux - General 5 12-28-2003 05:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

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
Open Source Consulting | Domain Registration