Truncate Log File Use the truncate command to shrink or extend the size of each FILE to the specified size:
1 |
truncate -s 0 logname.log |
The -s option is used to set SIZE to zero. See truncate command man page for more details:
1 |
man truncate |
That’s all folks.