LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-29-2001, 03:58 AM   #1
Jonah W
LQ Newbie
 
Registered: Aug 2001
Posts: 2

Rep: Reputation: 0
Post 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
 
Old 08-29-2001, 04:21 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,398

Rep: Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prune Portage tree beaucoup Linux - Software 3 02-05-2005 04:03 PM
Firefox logs user out? Where are error logs? case1984 Linux - General 0 10-09-2004 02:22 PM
How to prune a print & file server to leave minimal services running wolfpeach Linux - Security 4 06-29-2004 06:35 AM
Need help with some commands to prune files... smeenge Linux - Software 2 05-21-2004 05:10 PM
Separate firewall logs and general logs dominant Linux - General 3 04-20-2004 01:26 AM


All times are GMT -5. The time now is 03:23 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration