empty a file in linux

 

 

 


 

[1]

truncate -s 0 myfile.txt

[2]

> myfile.txt

[3]

cat /dev/null > myfile.txt

[4]

cp /dev/null myfile.txt