Ok, so I'm trying to empty a file. It's a text log file, which is being written continuously. My ls -lh says it's 3GB
My ls -lh says it's still 3GB
However the size of the folder containing this file is 3GB less. Weird enough, counting the lines says it's not empty, and i cannot open it with vim (too big).
I don't have admin access however i am the owner of the file.
I tried to create a new file with only the first line to see what's going on
head -1 file.log > first_line.txt
And the first_line.txt is 3GB. This is indeed an weird behaviour.
Question 1: Why is my first command not emptying the file?
Question 2: How can i empty the file without deleting it?
EDIT after comments: the file is being open and written by other processes, continuously.
Sadly i cannot interfere with those processes, so i cannot temporarly quit or restart them