How to empty a file in Ubuntu?

< 1 min read

To clear or empty a file in Ubuntu without opening it, you can simply open the terminal and use the following command.

> filename.txt

That’s it. The contents of the file filename.txt will be cleared without opening it.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.