[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"

One comment on “[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 *

363,365 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by sweet Captcha