David Brown wrote:
> On Sat, Jul 26, 2008 at 12:50:37PM -0700, James G. Sack (jim) wrote:
>> Urivan Saaib wrote:
>>> Unless what John is trying to do is sort the files from older to
>>> newest, I
>>> don't see "-exec " to be an option. If sorting the files is not a
>>> requirement then -exec should be the way to go.
>>>
>>> I guess the only way to fix the output for 'ls' is to pipe 'find'
>>> results
>>> to 'sed' and escape all the shell special characters, but that'll
>>> depend on the shell isn't? :)
>>>
>>
>> Did you miss the solution previously offered by David?
>>
>> find /home/ftp -mtime +238 -name \*.mpg -print0 | xargs -0 ls -lt
>
> I missed the part about sorting by mtime. With GNU utilities how about:
>
> find ... -printf '%T@ %p\n' | \
> sort -nr | cut -d' ' -f 2- | \
> xargs -d'\n' ls -lU
>
> putting the find expression in for the ...
>
I guess _I_ must be missing something. I was quoting the solution you
(David) previously posted, which seems to me to deal properly with
embedded whitespace in names and to sort by mtime as asked.
Further, per SJS's suggestion, even the xargs stage is dispensible since
find added the "-exec command {} +" syntax.
So is there some subtlety flying over my head here? =-O ;-)
Regards,
..jim
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list