I have a log file that has a bunch of stuff in it that I don't need anymore. I want to clear the contents.
I know how to print the contents to the screen:
I know how to edit the file, line-by-line:
But I don't want to delete each line one at a time. Is there a way to do it in one command without destroying the file to do it?
This worked for me: