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 1 Question 90 Discussion

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

Which grep command will print only the lines that do not end with a / in the file foo?

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Bette
28 days ago
I'm having a slash of a time trying to decide, but I'm leaning towards option C. Gotta love those grep commands!
upvoted 0 times
...
Maybelle
1 months ago
This question is a real slash-and-burn, isn't it? I'm glad I read the options carefully.
upvoted 0 times
Sheridan
9 days ago
No, I believe it's D) grep -v '/#' foo
upvoted 0 times
...
Kenny
23 days ago
I think the answer is C) grep -v '/$' foo
upvoted 0 times
...
...
Dudley
1 months ago
I was about to choose option A, but then I realized that it would print the lines that *do* end with a slash, not the ones that don't. Good catch, Bette!
upvoted 0 times
Tonja
9 days ago
Yes, you're right. Option A would print lines that end with a slash, not the ones that don't.
upvoted 0 times
...
Salena
29 days ago
I think the correct option is C) grep -v '/$' foo
upvoted 0 times
...
...
Vanesa
2 months ago
I'm not sure, but I think it's either A) grep '/$' foo or C) grep -v '/$' foo
upvoted 0 times
...
Fatima
2 months ago
I agree with Mona, because the -v option in grep is used to invert the match
upvoted 0 times
...
Bette
2 months ago
Hmm, I think option C is the correct answer. The -v flag in grep is used to invert the match, so it will print the lines that don't end with a slash.
upvoted 0 times
Linn
21 days ago
Yes, the -v flag in grep will print the lines that don't end with a slash.
upvoted 0 times
...
Noel
1 months ago
I agree, option C is the correct answer.
upvoted 0 times
...
...
Mona
2 months ago
I think the answer is C) grep -v '/$' foo
upvoted 0 times
...

Save Cancel