New Bee for Unix -- Help me - Unix Commands

This is a discussion on New Bee for Unix -- Help me - Unix Commands ; Hi Friends i am new bee for unix, i have query 1. i have a log file which keeps appending Q - i want to capture day to day exceptions along with time from that log file and send to ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: New Bee for Unix -- Help me

  1. New Bee for Unix -- Help me

    Hi Friends

    i am new bee for unix, i have query

    1. i have a log file which keeps appending

    Q - i want to capture day to day exceptions along with time from that log file and send to another file, also i want only specific exceptions (not all)

    A -- i am using tail -f "logfile" | grep exception "logfile" >> "path to save the file"

    Pls guide me...

  2. Thumbs up Re: New Bee for Unix -- Help me

    You are using tail -f to get the logfile content.-f will always wait for data to append on the file.

    You can not simultaneously execute tail -f and append the result to a file.

    Because the contents will not permanently append to the error file.since it is waiting for the tail command's execution to finish.So you can not append it using '-f'.

    Code:
           tail logfile | grep "exception" logfile >> error_log

+ Reply to Thread