LPI
101-400 · 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
(24 responses)- A4% (1)
- B83% (20)
- C4% (1)
- D8% (2)
Community Discussion
No community discussion yet for this question.