From: Peter Bailey Date: 2013-01-09T21:08:35+09:00 Subject: Re: One liner for filenames 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/.