Empty logfiles

Robert Bonomi bonomi at mail.r-bonomi.com
Wed Aug 29 20:11:38 UTC 2012


> From owner-freebsd-questions at freebsd.org  Wed Aug 29 15:02:37 2012
> Date: Wed, 29 Aug 2012 21:59:17 +0200
> From: Jos Chrispijn <ports at webrz.net>
> To: freebsd-questions at freebsd.org
> Cc: 
> Subject: Empty logfiles
>
> Stupic question: I have a directory with 120 logfiles (extension *.log).
> Can someone tell me how I can empty these logfiles in one command?
> I thought 'echo > *.log' would work, but no way K-)

Assuming 'sh', or something 'syntactically equivalent':

    for file in *.log ; do ; echo "" >$file ; done





More information about the freebsd-questions mailing list