I want to remove the first $rmv lines of a huge text file called $filename. This text file is so big that I cannot fit two copies of it on my hard drive.
The following leaves me with a blank file called $filename:
tail -n +$rmv "$filename" > "$filename"
The following cannot execute because I do not have the storage space to fit both $filename and $filename.tmp:
tail -n +$rmv "$filename" > "$filename.tmp" && mv "$filename.tmp" "$filename"
If it matters, I'm using Mac OS X El Capitan.
/tmp. – Wildcard Mar 29 '16 at 19:29