Page 1 of 1

how to empty all logfiles

Posted: 30 Sep 2008, 13:32
by squadra
I'm learning ssh because of the bubba2 :-) but can't find the command to empty all .log files. I know i'm not creating much space with it but i don't need the log file content when it is that old ...

Re: how to empty all logfiles

Posted: 30 Sep 2008, 13:55
by carl
squadra wrote:I'm learning ssh because of the bubba2 :-) but can't find the command to empty all .log files. I know i'm not creating much space with it but i don't need the log file content when it is that old ...
That is seldom needed, as most logging is done via a system called "logrotate", which takes care of log files not growing too big, and to remove old log files when needed.
Though if you feel you must, the quick and dirty way to truncate a file is as following:

Code: Select all

: > file
/Carl