LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-22-2004, 06:04 AM   #1
sachinh
Member
 
Registered: Jul 2004
Location: india
Distribution: RH
Posts: 189

Rep: Reputation: 30
Question how to search files with specific contents ?


Hi Linux-GURUs ,

Actually i am looking for a command that will allow me to search for files with specific contents . I know one command for searching specific files .
i.e. Locate command .....but how to find specific contents ?? . Please help me out . I'm using RedHat 9.0 . U need more details ?? .

Thanks in advance .... !!!! Cheers !!!!!!! .
 
Old 07-22-2004, 06:14 AM   #2
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
# grep "foo bar" *
 
Old 07-22-2004, 06:41 AM   #3
sachinh
Member
 
Registered: Jul 2004
Location: india
Distribution: RH
Posts: 189

Original Poster
Rep: Reputation: 30
thanx

thanx Frustin .... it worked ....
 
Old 07-22-2004, 06:43 AM   #4
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
of course it did
 
Old 07-22-2004, 09:00 AM   #5
iainr
Member
 
Registered: Nov 2002
Location: England
Distribution: Ubuntu 9.04
Posts: 631

Rep: Reputation: 30
If you had wanted to search files that weren't all the current directory, something like

find /mydir -exec grep foobar {} \;

would have worked.
 
  


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
Help working on a script to search for specific data. oracle11112 Programming 26 05-28-2005 08:00 PM
howto search contents of the packages longnam Slackware 4 04-01-2005 11:51 AM
Java: Getting the contents of a search dialog box in text editor i am making ludeKing Programming 4 04-23-2004 09:46 PM
search for specific text in fields using awk Helene Programming 2 04-23-2004 01:13 AM
search all book *contents* @ amazon.com jimveta General 2 10-24-2003 01:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:56 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
Open Source Consulting | Domain Registration