cat /dev/null > logfile
or
truncate logfile --size 0
<
>
linux - Is there a way to delete/truncate a file while a process is writing
unix - Truncating a file while it's being used (Linux)
how to backup & truncate the log file while the process is running
linux truncate file in use
linux truncate command
how to clear apache logs
linux truncate file to specified size