In my Python script I needed a fast/efficient way to set a max filesize on a file I'm constantly writing to. Rather than bring the whole thing into py's RAM, I ran this shell command:
sed -i '1d' file.csv
I monitor the filesize periodically and run the command as needed. Problem is that now if I tail -f file.csv
, tail stops tailing the file as soon as sed removes a line from it. Any solution?