Which of the following commands will output all of the lines with the name Fred in upper or lower case but not the word red from the file data_file? (Choose two)
Suggested Answer: D, E
Get Premium LFCS Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
31 comments · newest first
RO
Robt
7 months ago
I’m leaning towards D and E too. Makes sense!
AD
Adolph
7 months ago
E handles that well.
LU
Luisa
7 months ago
B is too specific. What about the case sensitivity?
AD
Adolph
7 months ago
I prefer B and E.
CA
Carey
7 months ago
It matches both cases, Fred and fred.
AM
Amalia
8 months ago
Why D?
CA
Carey
8 months ago
I think D and E are correct.
LA
Laura
8 months ago
I thought grep -i would include "red" too, but I guess not!
CE
Celeste
8 months ago
A is definitely wrong, it excludes everything with "fred".
CA
Catina
9 months ago
Haha, good thing we don't have to worry about that 'red' word. D and E are the way to go!
RE
Rebbeca
9 months ago
D and E are the winners. Who needs to worry about that pesky 'red' word when you've got the power of grep?
FL
Fletcher
9 months ago
D and E are the way to go. Gotta love that case-insensitive grep!
SH
Shawnna
9 months ago
I think D and E are the correct answers. The -i option in grep is perfect for matching both upper and lower case.
TI
Timothy
9 months ago
D and E look good to me.
SO
Sommer
10 months ago
I'm not entirely sure, but I remember something about the -i flag making it case insensitive, so maybe option E is also right?
WE
Wendell
10 months ago
I think option D is correct because it matches both "Fred" and "fred" using the character class.
JU
Jules
10 months ago
Hmm, I'm not sure about the difference between grep and egrep here. I'll need to review the details of each option.
LY
Lyndia
10 months ago
I've got it! Options D and E should do the trick. The case-insensitive search will get all instances of "Fred", and the -v flag in option A will exclude "red".
DI
Dino
10 months ago
I'm a bit confused by the "not the word red" part. I'll need to double-check the options to make sure I don't include that.
MI
Ming
10 months ago
Wait, how does D work?
EN
Ena
11 months ago
Definitely agree with E!
BI
Billye
11 months ago
I think D and E are the right ones.
SA
Sanda
11 months ago
I’m confused about option A; it seems like it would exclude all lines with "fred," not just the word "red."
PR
Precious
11 months ago
I practiced a similar question, and I feel like option B might not work since it only matches "fred" in lowercase.
BE
Beckie
11 months ago
Okay, I think I know how to approach this. I'll need to use a case-insensitive search to get both upper and lower case "Fred".
LY
Lynsey
12 months ago
Hmm, this looks like a tricky one. I'll need to think carefully about the different options.
AL
Alaine
6 months ago
B is tricky, but it won't exclude "red".
MA
Margurite
6 months ago
What about B? It seems valid.
LI
Linsey
6 months ago
E is good for case insensitivity too.
CH
Chantell
6 months ago
Definitely! D captures both cases.
KE
Keneth
6 months ago
I think D and E are the best choices.