nerdexam
CompTIA

LX0-101 · Question #444

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

(31 responses)
  • A
    16% (5)
  • B
    74% (23)
  • C
    6% (2)
  • D
    3% (1)

Community Discussion

No community discussion yet for this question.

Full LX0-101 Practice