Kim Pedersen wrote in post #1091524:
>>
>> I need to basically delete all of the files except for the first one,
>> the one with the "_1" suffix at the end. Can I do that wiith a
>> one-liner?
>>
>> Thanks,
>> Peter
>>
>
> Hi,
>
> This should work
>
> ruby -e "Dir.glob('*_*.png')[1..-1].each { |fn| File.delete fn}"
>
> Best regards
> Kim

Thank you very much, Kim. It's a big help.
Cheers.

-- 
Posted via http://www.ruby-forum.com/.