Languages

Linux - how to empty the file from command line?

13 points
Asked by:
Kate_C
19790

How to remove the content of a file under linux from command line level?
I do not want to remove the entire file and create new file.
I just want to clear the entire file to 0 bytes.
What is the best way to do it?

1 answer
1 points
Answered by:
Kate_C
19790

Run following command:

echo "" > /path/to/my/file

 

0 comments Add comment
Native Advertising
50 000 ad impressions - 449$
🚀
Get your tech brand or product in front of software developers.
For more information contact us:
Red dot
Dirask - friendly IT community for everyone.

❤️💻 🙂

Join