Many Linux distributions are preconfigured to automatically and periodically rotate syslog log files by means of cron jobs that call logrotate or a similar log rotation script. However, if you want to clear a log file manually, you can simply use the greater than sign followed by the log file name. For example, to manually clear the file kern.log, you can run this command:
me@mycomputer:> /var/log/kern.log
The beauty of this is that the cleared out file still retains its original permissions and ownership.








its great man
good shortcut to clear the logs
thanks
lmao…. I have been looking everywhere for this… Thanks
nice one, i was using /dev/null > logfile but this is so much better
Hi Joe,
I need one more small info..
How do you programatically clear a local0.log remotely from a windows system?
@ Anonymous, use SSH to login via Putty or Pterm, you should always have sshd configured to refuse root login, the best method is to login as your normally would and su or sudo as root!
Thanks, worked, i was looking for this…