duncan at sodatrain.com writes:
> 1) Truncate a log file to a specific number of lines so that lines
> from the beginning of the file are deleted until the specified number
> of lines remain.

tail -nLINES logfile > tmp && mv tmp logfile

> 2) Split a log file into 2 files so that a certain number of lines are
> removed from the primary file and dumped into a secondary file

split -nLINES logfile tmp && mv tmpaa old && mv tmpab logfile

-- 
David Phillips <david at acz.org>
http://david.acz.org/


_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list