Quickest Way to Truncate a File in Linux

Ready? It’s:

:> filename

(i.e. colon greater-than followed by the name of the file). This can also be used to create a new, empty file.

Tags:

Leave a Reply