I have a process that\'s writing a lot of data to stdout, which I\'m redirecting to a log file. I\'d like to limit the size of the file by occasionally copying the current
I downloaded and compiled the latest coreutils so I could have truncate available.
Ran ./configure and make, but did not run make install.
All the compiled utilities appear in the "src" folder.
I ran
[path]/src/truncate -s 1024000 textfileineedtotruncate.log
on a 1.7 GB log file.
It did not change the size listed when using ls -l, but it did free up all the disk space - which is what I really needed to do before /var filled up and killed the process.
Thanks for the tip on "truncate"!