The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Difference grep, egrep and fgrep ravind27 UNIX Desktop for Dummies Questions & Answers 2 06-14-2009 07:37 AM
How to negate grep result? mmdawg Shell Programming and Scripting 4 05-05-2008 08:24 AM
egrep counting every 2 lines of result as 1 Orbix UNIX for Dummies Questions & Answers 1 11-20-2007 08:12 PM
grep/awk/egrep? whugo UNIX for Dummies Questions & Answers 3 01-20-2006 12:51 AM
need to grep or egrep the running processes in C file jimmynath UNIX for Advanced & Expert Users 5 09-08-2005 04:26 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-07-2008
tvrman tvrman is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 9
egrep/grep result of more files

hi ,

I'm new at unix bash scripting, im playing a little bit with egrep/grep.

I have serveral files and i do a search on those files, like "aki", the result
is many rows outcoming and serveral of them are dubble because aki wil come more than ones in a file, how can i get a result that it will show only
one outcoming per file, i mean i need only to know it aki is in the file yes or no, then only show the files names where the result is true, now it
find in some files over more that 10 times, the result is 10 times the same file. (that's logic..)

Thanks
  #2 (permalink)  
Old 08-07-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
Use the -l option to only list the names of files which match.
  #3 (permalink)  
Old 08-07-2008
Dhruva's Avatar
Dhruva Dhruva is offline
Registered User
  
 

Join Date: Mar 2006
Location: India
Posts: 255
Code:
grep -l "searchstring"  filename
Please see man command for the help text.
  #4 (permalink)  
Old 08-07-2008
tvrman tvrman is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 9
Oops i missed that one,

Thanks all!
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:57 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0