How do I prune logs manually?
What's the command to prune logs manually from the command line? I want to cut, say, half the lines from a log file ... what would I type in?
Thanks - JW |
What half of the lines do you want to cut out?
I'd guess you want to get rid of the first half, as it's older... Assuming this... tail -200 /var/log/message > newloglife will only keep the last two hundred lines. Then again you might want cat /var/log/message | cut -b -25 > newlogfile Which would still get rid of about half of it, but erm.. the last half of each line... not so useful methinks. |
All times are GMT -5. The time now is 04:03 PM. |