I want to sort the results of grep -rl 'string' .
by create date or modification date.
find . -type f -cmin -90 |xargs ls -1t |xargs grep -l "pattern"
And of course xargs is what passes output of one command as parameters to another. Which is why you want to pre-filter the list with find to avoid having too many.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.