|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | 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 Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to list content with file name ?
I want to search the string including the symbol like 'search' for example, file a.txt in \\dir contains, a for 'appable' b for 'banana' c for 'cat' s for 'search' Here I need to display(serach outpur) like \\dir\a.txt s for 'search' ... ... How to list content with file name for current + sub directories ? I tried below commands for the above serach Code:
find . -exec grep -i "'search'" {} \; - listing content only
find . -exec grep -l "'search'" {} \; - listing file name only
find . -exec grep -il "'search'" {} \; - listing file name only
grep "'search'" * - looking current directoryI need to display content with file name help me Thanks! Last edited by gkskumar; 12-28-2009 at 05:21 AM.. Reason: removed links, added code tags |
| Sponsored Links | ||
|
|
|
#2
|
|||
|
|||
|
How about: Code:
grep -r "'search'" "$(pwd)"/* Last edited by Scrutinizer; 12-28-2009 at 06:35 AM.. |
|
#3
|
|||
|
|||
|
Hi how about :- Code:
find . -print | xargs grep -i "search" cheers |
|
#4
|
|||
|
|||
|
find . -exec grep "'search'" { } \; -print
|
|
#5
|
|||
|
|||
|
Code:
find . -exec grep -H "'search'" {} \; |
|
#6
|
||||
|
||||
|
grep -RH "'search'" *
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Extract specific data content from a long list of data | patrick87 | Shell Programming and Scripting | 11 | 12-14-2009 01:07 AM |
| Shell script or command help to extract specific contents from a long list of content | patrick87 | Shell Programming and Scripting | 2 | 10-07-2009 09:11 PM |
| list file content as individual variables | petersf | Shell Programming and Scripting | 4 | 10-06-2009 11:55 AM |
| Need help with awk - how to read a content of a file from every file from file list | tanit | Shell Programming and Scripting | 7 | 03-10-2009 04:19 AM |
| find for specific content in file in the directory and list only file names | madhu_Jagarapu | AIX | 2 | 12-23-2008 01:13 AM |