Find the answer to your Linux question:
Results 1 to 2 of 2
Say, I have a log file /var/log/messages. Now all i want is to delete the first line through script without disturbing provisioning the file. Anyone who can help me with ...
  1. #1
    Just Joined!
    Join Date
    Nov 2007
    Posts
    6

    How to delete the first line of log file ?

    Say, I have a log file /var/log/messages. Now all i want is to delete the first line through script without disturbing provisioning the file.
    Anyone who can help me with that?

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    The question is, why? The file /var/log/messages contains information about system activities, and is cycled (by default) once a week. IE, last weeks is in /var/log/messages.1, etc. In any case, this file is under control of the kernel. You should not mung with it. If you need to remove the first line, then copy everything else after the first new-line to another file.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

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