Search This Blog

Monday 25 January 2010

Ubuntu Clear Log Files

Re: How do I clear my log files?

Deleting the log files should be safe, though it contains subdirectories that also need to be recreated if you remove it with rm -r. Instead, use find to only remove the files.

Code:

sudo find /var/log -type f

will list all files under /var/log. Adding -delete behind that command will delete those files (i.e sudo find /var/log -type f - delete)