Trim a Unix log file

Sometimes log files can grow to the point when you just need to trim off some of the content from the start of the file i.e. the first x number of lines. This can be done easily with the following command

sed -i -e <start line number> , <end line number>d <filename>

Leave a Reply

Your email address will not be published. Required fields are marked *