
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
Search
Categories
Recent Posts
Top Git interview Questions for Experienced Developer
Speed-up tips and tricks for Windows 11
Top 15 Linux Commands used by Experienced Developer
Top SQL Interview Examples for Experienced Developer
Internal Working of Java HashMap
Recent Tags