[mythtv] an idea from ruby on rails

Ronald Frazier ron at ronfrazier.net
Fri Jan 25 15:46:43 UTC 2008


> > ls -t dump-*.sql | head -7 | xargs rm
>
> I don't understand this last line - you delete the 7 latest files? Shouldn't
> that be "head -n -7" to delete all but the 7 latest?

In that case, you'd also have to use the -r switch on your "ls".

ls -tr dump-*.sql | head -n -7 | xargs rm
ls -t dump-*.sql | tail -n +8 | xargs rm

Both of those should work....I think

-- 
Ron


More information about the mythtv-dev mailing list