Clear Log or any file without removing or deleting it and retaining permissions

arrow document1

There are many other ways to do this, but an easy way to remember is this command:

cat /dev/null > /the/path/to/file.sh
 
Source: sMyles

advertisement:
smyles 56 36
sMyl.es

cat clear log files Linux Tutorials