LinuxQuestions.org
Visit Jeremy's Blog.
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 04-11-2005, 05:24 AM   #1
abhi
LQ Newbie
 
Registered: Apr 2005
Location: India
Distribution: REd Hat AS 3.0
Posts: 4

Rep: Reputation: 0
Lightbulb pattern search through find command.


Through Find command How can i find files those are having pattern like "Computer" Written in there first line.
i wants to display only name of the file those are having above mentioned pattern.
 
Old 04-11-2005, 05:37 AM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,314

Rep: Reputation: 175Reputation: 175
try:

Code:
find . -type f -exec grep -n 'Computer'  /dev/null  {} \; |  grep :1:
 
Old 04-11-2005, 11:31 AM   #3
abhi
LQ Newbie
 
Registered: Apr 2005
Location: India
Distribution: REd Hat AS 3.0
Posts: 4

Original Poster
Rep: Reputation: 0
Smile Thanks!

Thanks Billy i get it.
 
  


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
What is the Package Search pattern Syntax for dpkg --list? Akhran Debian 3 08-23-2005 06:23 AM
Find command using 2 search conditions nifflerX Linux - General 8 07-15-2005 02:37 PM
search for pattern in files and replace mizuki26 Linux - Newbie 3 01-04-2004 12:57 PM
Pattern search in a line jitz Linux - General 2 12-06-2003 05:50 AM
multiline pattern search in a file mimi Linux - General 1 09-01-2002 01:22 PM


All times are GMT -5. The time now is 11: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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration