Try: ls -rt *.txt | xargs grep -l
I use this rather than just grep, so the results are sorted in chronological order of file creation, possibly spanning multiple days, rather than ...
You can do something like this: function php_grep($path){ $ret = array(); $dates = array(); $fp = opendir($path); while($f = readdir($fp)){ if( preg_match("#^\.+$#" ...
Neither ack or grep have any notion of a file's modification dates. For that you'll need to generate the list of files first, and then sort them based ...
I need the " grep results" displayed in the order of the files modified/created. Original Post by ...
You should set the environment variable LC_ALL to C before running sort or sgrep.
E.g., if I'm searching a bunch of files which are in chronological order,
Pipe, Grep and Sort Command in Linux/Unix with Examples
Est. reading time, 1m
-t Sort by time modified (most recently modified first) before sorting the operands by lexicographical order. -c Use time when file status was last ...