[Linux] Clearing the file content without deleting it

October 11, 2012 in Linux

In some situations, you may need to clear the file content without deleting the file. In order to do this in Linux environment, you can simply run the following command:

cat /dev/null > "Your file path"

1 response to [Linux] Clearing the file content without deleting it

  1. Or:

    > “Your file path”

Leave a reply

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


Skip to toolbar