Practice this fail.
The text thinks it’s a flag.
GNU grep · Restart as often as you like
Read the error, choose a command, and learn
why it works. Nothing runs on your machine.
Using GNU grep, find lines in flags.txt containing the literal text -n. Your earlier attempt interpreted the pattern as an option.
The text thinks it’s a flag.
$ grep '-n' flags.txt
That dash has other plans.