Web Page Templates Icons, Clipart, Logos

Blog

Hot Topics

Post Archive

Tags

Aug 04, 2009 01:01 AM EDT

Clearing Log Files on Linux

My secure and messages log files were getting really big, and after analyzing them to see if there was a reason, I decided to clear them out.

To do so, I first typed: cat > messages, then typed a couple of blank lines, and hit control-c to quit. I did the same for the secure log file. This cleared the file, but no new messages were being added to the logs. After kicking myself for being stupid, I searched around and found two important things.

First, it’s easier to clear a file by simply typing “> filename”, and second, the syslog daemon is reponsible for writing to those files. Restarting it restores its ability to write to the file. I restarted it by going to /etc/init.d and running ./syslogd restart

Darren log files | linux

Clearing Log Files on Linux

Title:
Your Name:
Your Comment:
Please enter the text from the image in the box below:

 

 

 

 

 

Resource Links