Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Linux Foundation Exam LFCS Topic 4 Question 86 Discussion

Actual exam question for Linux Foundation's LFCS exam
Question #: 86
Topic #: 4
[All LFCS Questions]

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)

Show Suggested Answer Hide Answer
Suggested Answer: D, E

Contribute your Thoughts:

Vilma
3 months ago
I'm feeling lucky, so I'm going with A and D. The -v option in A will exclude 'red', and D covers both cases. Fingers crossed!
upvoted 0 times
Argelia
2 months ago
User 3: I agree, D covers both upper and lower case for Fred.
upvoted 0 times
...
Tiffiny
2 months ago
User 2: I'm not so sure about A, but D seems like a safe bet.
upvoted 0 times
...
Janine
3 months ago
I think A and D are the right choices too.
upvoted 0 times
...
...
Francene
3 months ago
What, no option for 'grep Fred | sed 's/red//' data_file'? That would be my choice. Gotta love those one-liners!
upvoted 0 times
Sylvia
2 months ago
User 3: I'm not sure about those options. Maybe we should try them all to see which one works best.
upvoted 0 times
...
Lisbeth
2 months ago
User 2: Yeah, I agree. Option E) grep -i fred data_file should also do the trick.
upvoted 0 times
...
Ena
3 months ago
I think option D) grep '[Ff]red' data_file would work.
upvoted 0 times
...
...
Aimee
4 months ago
I'm not sure, but I think E) grep -i fred data_file might also work since -i ignores case.
upvoted 0 times
...
Shenika
4 months ago
I agree with Desiree, because using [Ff] will match both upper and lower case.
upvoted 0 times
...
Adell
4 months ago
This is a tricky one! I'm going to say C and E. The egrep command is like grep but with extended regular expressions, and the -i option makes it case-insensitive.
upvoted 0 times
Judy
2 months ago
I believe B and D are the correct commands to use.
upvoted 0 times
...
Dottie
3 months ago
I'm not sure, but I think A and D might be the right choices.
upvoted 0 times
...
Corinne
3 months ago
I would go with D and E, the -i option ignores case.
upvoted 0 times
...
Shakira
3 months ago
I think C and E are the correct options.
upvoted 0 times
...
...
Rima
4 months ago
I'm going with B and D. The [f]red pattern in B will match 'Fred' but not 'red', and D covers both upper and lower case.
upvoted 0 times
...
Rosio
4 months ago
Hmm, I think the answer is D and E. The -i option in grep makes the search case-insensitive, and the [Ff] character class matches both uppercase and lowercase 'Fred'.
upvoted 0 times
Carey
3 months ago
Great job on figuring that out!
upvoted 0 times
...
Mira
3 months ago
So, [Ff] matches both uppercase and lowercase 'Fred'.
upvoted 0 times
...
Clare
3 months ago
Yes, you are correct. The -i option makes it case-insensitive.
upvoted 0 times
...
Chaya
4 months ago
User2
upvoted 0 times
...
Sue
4 months ago
I think the answer is D and E.
upvoted 0 times
...
Josphine
4 months ago
User1
upvoted 0 times
...
...
Desiree
4 months ago
I think the answer is D) grep '[Ff]red' data_file.
upvoted 0 times
...

Save Cancel