delete lines text file linux

C++
sed -i '' '/pattern to match/d' ./infile

Source

Also in C++: