![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| search two words in sed | ajitkumar2 | Shell Programming and Scripting | 12 | 08-01-2008 12:00 AM |
| grep on multiple words to match text template | rider29 | Shell Programming and Scripting | 6 | 05-23-2008 08:21 AM |
| problem with grep on search string in a txt file over multiple files | m00 | UNIX for Dummies Questions & Answers | 2 | 05-18-2008 11:21 AM |
| grep with find to search for matchiing words | akhil313 | UNIX for Dummies Questions & Answers | 1 | 12-12-2006 07:18 AM |
| multiple search with grep | amon | Shell Programming and Scripting | 5 | 04-04-2006 03:53 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi frnds
i want to desplay file names that should be word1 and word2 ex : i have 10 *.log files 5 files having word1 and word2 5 files having only word1, i have used below command egrep -l 'word1|word2' *.log its giving all 10 files, but i want to display only 5 files having both words |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Any one please give a solution.......
|
|
#3
|
|||
|
|||
|
grep for "word2" you will get the 5 files.
$ find . -name "*.log" -exec grep -l "word2" {} \; |
|
#4
|
|||
|
|||
|
i want file names that should be word1 and word2
|
|
#5
|
|||
|
|||
|
did you tried with the command which i given.
It will give you the filename only. |
|
#6
|
|||
|
|||
|
i have tried but that one given file name having only word2,
but i want filenames that should be word1 and word2.... |
|
#7
|
|||
|
|||
|
i have tried with below statement,its giving a file names but some files having only 6314245093 number i.e its working like or
i am searching for & find . | egrep -l "379400000000005|6314245093" zisfcon_080820*.log |
|||
| Google The UNIX and Linux Forums |