0

How to empty the content of a file in Linux CentOS Distro

Hello,

Is there any possibility to empty the content of a file through a command On CentOs 7.6?

CentOS Add a comment
otwol
asked Nov 05 2019

Answer

0

On CentOS Distro,to empty the file contents,use the following commands

truncate -s 0 filename

here in the above command -s indicates size where we are resizing the file to zero

Add a comment
linuxhelp
asked Nov 07 2019
Post your Answer