0

How to empty a file contents?

Hi, i want to empty the contents inside a file but i dont want to remove the file, How can i do it?

CentOS Linux Add a comment
ajinfernando
asked Feb 23 2018

Answer

0

You can use the truncate command to empty the values inside a file as shown below

truncate -s 0 file1
Add a comment
parthiban
asked Mar 04 2018
edited Oct 05 2018
Post your Answer