how to delete line in linux file code example Example: delete lines text file linux sed -i '' '/pattern to match/d' ./infile