Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-01-2010, 03:54 AM   #1
Registered: Sep 2005
Posts: 184

Rep: Reputation: 15
what command to shoot ?

I need a Linux command.

My objective is to find exception/errors in log file.

As of now, I just do a 'tail -200f ms01.log' ... this just prints the last 200 lines from the log files.

I'm not happy with my command. Can we make it smarter . I want to print only the exception stacks from my log file.

what command to shoot ?
Old 04-01-2010, 04:00 AM   #2
LQ Guru
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
tail -200f ms01.log | grep 'error'
Replace 'error' with the term you want to show lines containing. If more than one term is required, use:

grep 'term1\|term2\|term3'

Note: this is only a simple grep -- if you need to filter for strange words or regular expressions, you will need a heftier grep command.

Also: I believe you meant to write "Which command to execute", not "Which command to shoot"

Old 04-01-2010, 04:16 AM   #3
Registered: Sep 2005
Posts: 184

Original Poster
Rep: Reputation: 15
thanks for the correction . thanks for the help
Old 04-01-2010, 04:23 AM   #4
LQ Newbie
Registered: Mar 2010
Location: India
Distribution: RHEL
Posts: 22

Rep: Reputation: 16
Originally Posted by Volcano View Post
thanks for the correction . thanks for the help
tail -200f <LOGFILE> | grep -i '<PATTERN>'

This command will tail the particular log and output the line with the matching pattern ignoring case.

Hope this helps.

Old 04-01-2010, 06:21 AM   #5
Registered: Sep 2005
Posts: 184

Original Poster
Rep: Reputation: 15
Glad to know this ...thanks


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
what command to shoot ? Volcano Linux - Newbie 7 01-14-2010 06:14 AM
Gonna Shoot Myself.. (What Not To Do) ToBe Linux - Newbie 5 09-02-2005 07:15 PM
Don't shoot me, CD-4 question Wakim Mandriva 4 01-02-2005 10:17 PM
shoot the newbie... Tisch Debian 2 01-17-2004 06:30 PM
startx !!!! help me im about to shoot myself hydro Linux - Newbie 6 02-20-2003 03:10 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:49 AM.

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