System Administration Guide
Chapter 2, Administering filesystems

Clearing system log files from the command line

Clearing system log files from the command line

To clear a log file and retain the file permissions:

  1. Copy the file to a new filename. For example:

    cp /usr/adm/messages /usr/adm/messages.old

  2. Clear the file with one of these commands:
To monitor new information that is currently being appended to system log files, enter: 

tail -f /usr/adm/messages

The -f (follow) option to the tail(C) 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.