Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grep and ls question. 2

Status
Not open for further replies.

tijerina

Vendor
Mar 4, 2003
132
US
I am trying to grep a directory for strings that are in multiple files in this directory.

Example,

I want to find all the files in currentdir located in /dir1/subdir2/currentdir that contain a string SS0052S00 but I walso want to list the dates.

How do I do this?

Thanks..
 
Hi,

My text file contains something like following:

Code:
adsdfaddfd <some path1>
adlfjakflafaf /<some path2>
adfabzlhzxhledfdfe3dfstet  <some path3>
d3dfstet  <some other path>

How do I print or redirect only the path information to another file?
That is, each line in second file should contain all the file paths found in file1

If possible, please include a note explaining the commands in your reply.

Thanks,

RV
 
RVSachin,

Man, I am sorry but I have no idea what your reply to my question has anything to do with my original reply.

Did you mean to post a question and responded to mine accidentally?

 
I still need assistance with my original question. Can somebody assist me please..
 
Sorry,

That was a new thread, which accidentally got thro' as a reply to your thread. It was too late by the time I realized it.

Sorry!

RV
 
I want to find all the files in currentdir located in /dir1/subdir2/currentdir that contain a string SS0052S00 but I walso want to list the dates
fgrep -l SS0052S00 /dir1/subdir2/currentdir/* | xargs ls -l

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top