DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Performing basic system monitoring and tuning

Clearing system log files from the command line

To completely clear a log file, use a command like this:

cp /var/adm/sulog /var/adm/sulog.old
> /var/adm/sulog

To delete all but the last 50 lines:

tail -50 /var/adm/sulog > /var/tmp/sulog
mv /var/tmp/sulog > /var/adm/sulog

This creates a temporary file, and then moves the temporary file to /var/adm/sulog, thus truncating the file to the most recent entries. Examine log files for contents before truncating them. To monitor new information that is currently being appended to a system log file, enter:

tail -f /var/adm/sulog

The -f (follow) option to the tail(1) command prints the last 10 lines of the file, followed by any lines that are appended to the file between the time you initiated and stopped (with <Del>) the tail command.


Next topic: Clearing log files automatically
Previous topic: Using the System Logs Manager

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 22 April 2004