I have a 5 GB text file(log/debug)
I want to delete all lines containing 'TRACE'
Command used
sed -i '/TRACE/d' mylog.txt
Is there any other fastest way to do this?
I have a 5 GB text file(log/debug)
I want to delete all lines containing 'TRACE'
Command used
sed -i '/TRACE/d' mylog.txt
Is there any other fastest way to do this?
Hi, what do you mean with fastest? You can do:
grep -v TRACE mylog.txt > mylog2.txt
Grep tends to be a bit faster, but grep does provide the option of inline editing like GNU sed does, so you have to mv the file back to the original afterwards.