Empty a File Using Linux Command

Today i received an e-mail notification from cpanel that a partition in my server is almost full.
First i checked largest directories / files using this command :

du -h --max-depth=1 /some/path

Then i noticed that they were some log files which took space in my partition 🙂

After i analyzed which log files that i didn’t need, i must delete / empty them.

To empty a file in SSH, you can use this command :

truncate -s 0 /your/file/here

It is very easy 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *