How can I delete the last line of a file without reading the entire file or rewriting it in any temp file? I tried to use sed
but it reads the entire file into memory which is not feasible.
I want to remove the blank line from the end and save the change to the same file.
Since the file is very big and reading through the complete file would be slow, I am looking for a better way.