There is a simple command that will truncate the file to zero length without affecting any permissions. Here it is:
shell>:>filename
If the file already exists, it will be truncated to zero bytes, else this command will create an empty file. This is handy for truncating big log files.
Or you can use:
shell>cat /dev/null > some_log_file.log
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment