LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 04: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, 04:37 AM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
try:

Code:
find . -type f -exec grep -n 'Computer'  /dev/null  {} \; |  grep :1:
 
Old 04-11-2005, 10: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



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 05:23 AM
Find command using 2 search conditions nifflerX Linux - General 8 07-15-2005 01:37 PM
search for pattern in files and replace mizuki26 Linux - Newbie 3 01-04-2004 11:57 AM
Pattern search in a line jitz Linux - General 2 12-06-2003 04:50 AM
multiline pattern search in a file mimi Linux - General 1 09-01-2002 12:22 PM

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

All times are GMT -5. The time now is 01:22 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