Read more

Truncate files to zero length

Arne Hartherz
September 20, 2011Software engineer at makandra GmbH

This will reduce the filesize of foo and bar to 0 bytes:

truncate -s0 foo bar
Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

If the files do not exist they will be created.

You can use this to easily truncate your application's log files:

truncate -s0 log/*.log
Posted by Arne Hartherz to makandra dev (2011-09-20 16:38)