nerdexam
LPI

117-101 · Question #284

You want to search the file myfile for all occurances of string containing at least five characters, where character number 2 and 5 are 'a' and character number 3 is NOT 'b'. Which command would you…

The correct answer is B. grep .a[^b].a myfile. See the full explanation below for the reasoning.

Question

You want to search the file myfile for all occurances of string containing at least five characters, where character number 2 and 5 are 'a' and character number 3 is NOT 'b'. Which command would you use?

Options

  • Agrep a*^b*a myfile
  • Bgrep .a[^b].a myfile
  • Cgrep .[a].*.[a] myfile
  • Dgrep .a*^b..a myfile

How the community answered

(28 responses)
  • A
    7% (2)
  • B
    75% (21)
  • C
    14% (4)
  • D
    4% (1)

Community Discussion

No community discussion yet for this question.

Full 117-101 Practice