How to Empty a file

 Empty a file using command(terminal)

Method 1.

$ > test.txt

empty a file

for when you want to flush all content from a file without removing it.

Method 2.

$  truncate -s0 1.txt

Related Posts :

Linux Tutorial for Beginners

Importance command for Java developer

 

Leave a Reply

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

16 − = 10