Tips: Empty A File in Unix Using >

Neelkanth Ram

8 sec read

If you want to empty a file’s content in a Unix based system then simply use > like so:
[source]
$ > /var/log/foo.txt
[/source]
This sends the output of nothing to the file which will make it nothing.

Related posts:

Leave a Reply

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