On Wed, 29 Aug 2012 21:59:17 +0200
Jos Chrispijn <po...@webrz.net> wrote:

> 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-)

        find . -name \*.log -exec truncate {} \;

        man find and man truncate for the gory details.

-- 
Steve O'Hara-Smith <at...@sohara.org>
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to