cli.fail

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.

Browse all practice ↗

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.

Which command searches for the literal text -n?

3 attempts remaining

Read why this fix works

The text thinks it’s a flag.

grep -- '-n' flags.txt

The -- argument ends option parsing. The following -n is therefore treated as the search pattern, not a flag. Shell quotes keep characters together, but quoting alone does not tell grep to stop interpreting command options.

Practice rounds do not affect the daily score or local streak. Try today’s challenge, or choose another scenario.

Copy your result