Operating System - HP-UX
1831938 Members
3222 Online
110032 Solutions
New Discussion

grep file content and order by date

 
haeman
Frequent Advisor

grep file content and order by date

there are many files in a directory , I want to grep a word "testing" from these files and the result is order by date , I tried the below command , but it still can't order by date , can advise what can i do ?

grep -i "testing" *

find . -type f -exec grep -i {} \;
2 REPLIES 2
TTr
Honored Contributor

Re: grep file content and order by date

grep -l testing * | xargs ll -t

or

grep -l testing * | xargs ll -rt
TTr
Honored Contributor

Re: grep file content and order by date

You can still keep the "-i" option for upper and lower case grep-ing

grep -i -l testing * | xargs ll -t (or -rt)