I have a file called error.log on my server that I need to frequently truncate. I have rw permissions for the file. Opening the file in vi > deleting all content > saving wo
the credit goes for my senior colleague for this:
:> filename
This will not break log files, so you can even use it on syslog, for example.