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 ...
- 03-03-2010 #1Just 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?
- 03-04-2010 #2Linux Guru
- 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!


Reply With Quote