The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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
Grep help flood Shell Programming and Scripting 3 06-05-2008 10:14 PM
Grep Aejaz UNIX for Advanced & Expert Users 3 04-30-2008 04:10 AM
grep dineshr85 Shell Programming and Scripting 1 10-10-2007 01:52 AM
how to exclude the GREP command from GREP yamsin789 UNIX for Advanced & Expert Users 2 10-04-2007 11:59 PM
Make grep -c display like grep -n? Jerrad Shell Programming and Scripting 2 08-24-2006 09:20 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 03-03-2006
Registered User
 

Join Date: Mar 2005
Posts: 41
Using grep

I have a command (see below) which displays the name of any file containing the specified search string:

Code:
# grep -i -s -l "SIGILL" /var/mqm/errors/*.FDC
/var/mqm/errors/AMQ43618.0.FDC
#
How can this command be adapted so it displays the file's date stamp, i.e. as if I'm performing an ls -l on the resultant filename.

Code:
e.g.
-rw-r--r--   1 mqm      mqm           10577 Feb 25 04:34 /var/mqm/errors/AMQ43618.0.FDC
regards

Gareth
Reply With Quote
Forum Sponsor
  #2  
Old 03-03-2006
Registered User
 

Join Date: Dec 2005
Location: India
Posts: 218
edited as the response I gave was not correct

Last edited by gauravgoel; 03-03-2006 at 04:33 AM.
Reply With Quote
  #3  
Old 03-03-2006
Registered User
 

Join Date: Dec 2005
Location: India
Posts: 218
ok got it, do it in a single step

Quote:
ls -lrt `grep -i -s -l "SIGILL" /var/mqm/errors/*.FDC`
Gaurav
Reply With Quote
  #4  
Old 03-03-2006
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,683
Quote:
Originally Posted by m223464
Code:
# grep -i -s -l "SIGILL" /var/mqm/errors/*.FDC
/var/mqm/errors/AMQ43618.0.FDC
#
This should work, I think.

Code:
grep -i -s -l "SIGILL" /var/mqm/errors/*.FDC | xargs ls -l
Reply With Quote
  #5  
Old 03-03-2006
Registered User
 

Join Date: Mar 2005
Posts: 41
Both these worked.

many thanks

Gareth
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:34 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0