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:
$ > /var/log/foo.txt
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 *