To easily clear a log file or empty a big file.
Type this on a terminal,.make sure to zip or backup the file if you feel you might need it later.
> MyBigLog_file.txt
Yes, just type greater than sign,.followed by the filename of a log file or any file.
Don't do this in Production if not sure of the consequences.
If the file exists it will empty the file, if the file doesn't exist it will create the file.
Test it on a VM, to see what it really does before rolling out to production.
Cheers,. enjoy Linux and command line.
Be still and know God is in control!
Comments
Post a Comment