I'm trying to find files with the name of formClass.php
that contain a string of checkCookie and I want to list the files by date showing the date, size, owner and the group. The files are in my home directory.
I have this working, but it doesn't show date, owner, etc...
find /home -name formClass.php -exec grep -l "checkCookie" {} \;
I was thinking that I could add "trhg" to the list like this, but it didn't work:
find /home -name formClass.php -exec grep -ltrhg "checkCookie" {} \;
Thanks
Try find /home -name formClass.php -print0 | xargs -0 grep -l --null checkCookie | xargs -0 ls -l
ls -lt `grep -lr --include=formClass.php "checkCookie" *`
Take a look at man ls
for another sorting options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With