LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-13-2003, 05:00 PM   #1
wedgeworth
Member
 
Registered: Aug 2003
Posts: 234

Rep: Reputation: 30
log file editing....


i've got a huge log file and i only need to get out logs on certain dates....how do i trime the file down....or have some kind of redirection to another file that only writes the logs with the dates i want.....any help would be appreciated....

thanks
 
Old 11-13-2003, 06:08 PM   #2
iceman47
Senior Member
 
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123

Rep: Reputation: 47
let's say the file is /var/log/secure:

cat /var/log/secure | grep "Nov 11" > ~/trimmed_secure

this filters everything from Nov 11 and puts it into a new file trimmed_secure
 
Old 11-13-2003, 06:16 PM   #3
lenlutz
Member
 
Registered: May 2003
Location: philadelhpia pa
Posts: 92

Rep: Reputation: 15
grep "Nov 11" /var/log/secure > ~/trimmed_secure

no need, for the cat (unless you get a litle lonely)
 
  


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
The X Server won't log in after i tried editing the Xsession file on Fedora Core 3 SHERB142 Fedora 3 06-07-2005 12:18 PM
File editing digger Linux - Newbie 3 01-28-2004 03:42 PM
How to control log file size in /var/log? yan Linux - General 2 10-13-2003 05:00 PM
what log file generator that support squid log? heero82 Linux - Software 2 07-11-2003 08:52 PM
iptables, changing log file from /var/log/messages acid2000 Linux - Networking 3 03-11-2003 08:38 PM


All times are GMT -5. The time now is 02:16 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration