Languages

Linux - how to empty the file from command line?

13 points
Asked by:
Kate_C
21370

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
21370

Run following command:

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

 

0 comments Add comment
Native Advertising
­čÜÇ
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

ÔŁĄ´ŞĆ­čĺ╗ ­čÖé

Join