Useful command to clean all files content of a directory without removing it…

Use cases:

  • you have an application running and you don’t want to stop
  • you don’t want to think about reset file permission that somebody else has configured in a bad way
 for filename in *; do  echo "" > $filename;  done

Categories: Bash

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published.