Find the answer to your Linux question:
Results 1 to 2 of 2
I am trying to write a bash script and it's been a long time since I done much scripting. Part of this script requires me to find the last entry ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2005
    Posts
    2

    Find last entry in log file


    I am trying to write a bash script and it's been a long time since I done much scripting.

    Part of this script requires me to find the last entry of something in a log file.

    Obviously I can grep the log files to find the entries but how do I extract just the last entry?

    Can anyone give me any pointers as to where to start with this.

  2. #2
    Just Joined!
    Join Date
    Sep 2005
    Posts
    2
    Never mind, brain has started working again.

    Just pipe the grep command through tail -n 1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •