Re: find
> > > # find /var/log -type f -exec echo -n > {} \;
> > > Why find create a file called "{}", instead to erase files contents
> > Try find /var/log -type f -exec cp /tmp/blankfile {} \;
> But the files permissions/owner/group would be changed.
You're right. What about
echo echo -n \> \$1 /tmp/truncate &&
find /var/log -type f -exec sh /tmp/truncate {} \;
--
Johannes Franken
Professional unix/network development
mailto:jfranken@jfranken.de
http://www.jfranken.de/
Reply to:
- References:
- find
- From: Antonio Alberto Lobato <tomlobato@yahoo.com>
- Re: find
- From: Johannes Franken <jfranken@jfranken.de>
- Re: find
- From: Antonio Alberto Lobato <tomlobato@yahoo.com>