I am referring to How can you concatenate two huge files with very little spare disk space?
I\'m in the midst of implementing the following:
I found I had to use a combination of fallocate
and sed
before the file would shrink in size, so I had a 43MB file and I want to get it down to around 5MB
fallocate -p -o 0 -l 38m fallocate.log
I noticed this filled the first line with a bunch of "nonsense" characters but my file was still 43MB in size
I then used sed
to delete the first line
sed -i 1d fallocate.log
and the file size is now 4.2MB in size.