Which of the following commands would display the lines containing capital letters form the file "turkey.txt"?
Suggested Answer: A
Get Premium LCP-001 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
27 comments · newest first
CH
Charisse
11 months ago
E looks like a syntax error to me, not valid.
FI
Fidelia
11 months ago
Wait, can you really use grep like that? Seems off.
EL
Ellsworth
11 months ago
A is totally wrong, it won't show capital letters.
EM
Emmett
12 months ago
I think D is actually what you want.
LE
Leoma
12 months ago
Definitely B, that's the right command!
JO
Jolanda
12 months ago
I don't recall seeing anything like option E in our practice, it seems off to me, but I could be wrong.
NO
Noel
1 year ago
I feel like option D might be the right choice since it uses grep with a negative flag, but I'm not completely confident about that.
GE
Gerry
1 year ago
I'm not entirely sure, but I remember something about using wc for counting lines or words, so maybe A or C could be relevant?
AH
Ahmed
1 year ago
I think option B looks familiar since we practiced using grep to find specific patterns in files.
DA
Dante
1 year ago
I'm leaning towards option B as well. The question is asking for a command to display the lines containing capital letters, and grep with the [A-Z] pattern seems like the most straightforward way to do that. I'll go with B unless I can come up with a really good reason not to.
PA
Pamella
1 year ago
Okay, I think I've got this. Option B, "grep -n [A-Z] turkey.txt", should do the trick. The -n flag will show the line numbers, which could be helpful. I feel pretty confident about this one.
JO
Jose
1 year ago
Hmm, I'm a bit unsure about this one. I know grep can be used to search for patterns, but I'm not sure if the [A-Z] syntax is correct. Maybe I should double-check the grep documentation just to be sure.
RA
Rana
1 year ago
This looks like a straightforward grep question. I think option B is the way to go - it should display the lines containing capital letters from the file.
MA
Marsha
1 year ago
Wait, is it really that simple? I'm wondering if there's some kind of trick here. Maybe one of the other options is doing something more advanced that I'm missing. I'll have to think this through a bit more carefully.
LA
Laticia
1 year ago
Hmm, I think the employees themselves would be the best source here. They're the ones who can really speak to what motivates them and what rewards elements are most valuable.
CU
Curt
1 year ago
I think option D is trying to do the opposite of what the question is asking. Grep -v will display the lines that don't contain capital letters.
VE
Venita
1 year ago
Haha, option E is just silly. 'for [A-Z] in turkey.txt | count'? That's not even a valid command!
BE
Beatriz
1 year ago
Yeah, that's the command to display lines with capital letters.
AM
Ammie
1 year ago
I think the correct answer is B) grep -n [A-Z] turkey.txt
DE
Deandrea
1 year ago
I agree, option E doesn't make any sense.
NO
Nohemi
1 year ago
I'm not sure about option C. Piping the output of cat to wc and then specifying [A-Z] doesn't seem quite right.
RI
Rickie
2 years ago
I'm not sure, but I think option B makes sense because it specifies to search for capital letters in the file.
GE
Geraldine
2 years ago
I agree with Candida, grep command is used to search for patterns in files.
FR
Frank
2 years ago
Option B looks good to me. grep is the right command to search for patterns in a file, and the -n option will display the line numbers as well.
TI
Timothy
1 year ago
User 2: Yes, I agree. grep -n [A-Z] turkey.txt will display the lines with capital letters.
OZ
Ozell
1 year ago
User 1: I think option B is the correct one.
CA
Candida
2 years ago
I think the answer is B) grep -n [A-Z] turkey.txt.