![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| String search - Command to find second occurance | saurabhsinha23 | UNIX for Dummies Questions & Answers | 5 | 12-06-2007 08:03 PM |
| unix command/s to find files older than 2 hours in a directory | Presanna | Shell Programming and Scripting | 6 | 11-20-2007 09:22 AM |
| Help Using Grep command to Find the string in the files in the root directory | Subbu_Angeline | AIX | 3 | 01-17-2007 01:45 PM |
| Print lines with search string at specific position | HealthyGuy | Shell Programming and Scripting | 4 | 12-04-2006 09:47 AM |
| Question about Restricting Search path of FIND to current directory | super_duper_guy | UNIX for Dummies Questions & Answers | 2 | 10-17-2005 09:10 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Unix find command to print directory and search string
Hi
i need to print pathname in which the string present using 'find' command sample output like this Pathname String to be searched ---------- -------------------- /usr/test/myfile get /opt/test/somefile get Thanks in advance |
|
||||
|
not clear
Did you want to list the file that had the word 'get'. Is that the string you are referring to? Se if this works for you -
Code:
find /dir/from/where/you/want/to/search -type f -exec grep -l 'get' {} \; 2>/dev/null
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|