Linux Search Pattern Question:
Download Questions PDF

Indicate the right option to search for BOB, Bob, BOb or BoB?
a) grep -i Bob files
b) grep 'B[oO][bB]' files
c) grep '[BOB]' files
d) grep -v 'Bob' files

Answer:

b) grep 'B[oO][bB]' files

Download Search Pattern Interview Questions And Answers PDF

Previous QuestionNext Question
Which one is used to select only one copy of the repeated lines?
a) uniq -u
b) uniq -d
c) uniq -c
d) uniq -I
How can you search for blank line in a file?
a) $ grep " " file
b) $ grep "^$" file
c) $ grep [" "] file
d) $ grep [^$] file