Sometimes when we need to get fresh logs data in existing logs files and log file is too large to open, then we need to delete content of existing log files.
There are several ways to truncate or empty files.
- : > application.log
- cat /dev/null > application.log
- truncate -s 0 application.log
Empty All logs file ending with .log
sudo truncate -s 0 /<directory path>/**/*.log