Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Aug 2012 15:11:43 -0500 (CDT)
From:      Robert Bonomi <bonomi@mail.r-bonomi.com>
To:        ports@webrz.net
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Empty logfiles
Message-ID:  <201208292011.q7TKBhCJ092701@mail.r-bonomi.com>
In-Reply-To: <503E7495.7050306@webrz.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> From owner-freebsd-questions@freebsd.org  Wed Aug 29 15:02:37 2012
> Date: Wed, 29 Aug 2012 21:59:17 +0200
> From: Jos Chrispijn <ports@webrz.net>
> To: freebsd-questions@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






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208292011.q7TKBhCJ092701>