fart -v infile.txt "*EXTRA" > outfile.txt or fart -v infile.txt "EXTRA" > outfile.txt FindAndReplaceText (fart) with the -v option takes the infile, looks for each line containing the literal search string (*EXTRA) and suppresses the line when outputting the other lines in the file to the outfile.txt