LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I prune logs manually? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-prune-logs-manually-5971/)

Jonah W 08-29-2001 03:58 AM

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

acid_kewpie 08-29-2001 04:21 AM

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.