BlackFriday 2024! 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
23 days 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
Janine
10 days ago
I think A and D are the right choices too.
upvoted 0 times
...
...
Francene
25 days 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
Ena
15 days ago
I think option D) grep '[Ff]red' data_file would work.
upvoted 0 times
...
...
Aimee
1 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
1 months ago
I agree with Desiree, because using [Ff] will match both upper and lower case.
upvoted 0 times
...
Adell
1 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
Dottie
8 days ago
I'm not sure, but I think A and D might be the right choices.
upvoted 0 times
...
Corinne
17 days ago
I would go with D and E, the -i option ignores case.
upvoted 0 times
...
Shakira
18 days ago
I think C and E are the correct options.
upvoted 0 times
...
...
Rima
2 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
2 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
11 days ago
Great job on figuring that out!
upvoted 0 times
...
Mira
15 days ago
So, [Ff] matches both uppercase and lowercase 'Fred'.
upvoted 0 times
...
Clare
29 days ago
Yes, you are correct. The -i option makes it case-insensitive.
upvoted 0 times
...
Chaya
1 months ago
User2
upvoted 0 times
...
Sue
1 months ago
I think the answer is D and E.
upvoted 0 times
...
Josphine
1 months ago
User1
upvoted 0 times
...
...
Desiree
2 months ago
I think the answer is D) grep '[Ff]red' data_file.
upvoted 0 times
...

Save Cancel