BLACK FRIDAY SALE – Unlock Up to 25% OFF on All Exam Prep! - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

LPI 101-500 Exam - Topic 3 Question 119 Discussion

Posted by Melvin on Nov 19, 2025 at 04:53 PM

Which of the following commands will reduce all consecutive spaces down to a single space?

Suggested Answer: E

Get Premium 101-500 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
30 comments · newest first
HO
Honey 8 months ago
Agreed! E is the command we need.
NE
Nell 8 months ago
I feel confident about E. Clear and simple!
HE
Helaine 8 months ago
A won't reduce spaces properly. E is better.
RO
Rossana 8 months ago
I was confused by A. Thought it might work.
JO
Jonelle 8 months ago
Not sure about E, seems too simple to work.
VI
Vivan 8 months ago
Definitely E! It’s the go-to for squeezing spaces.
LE
Leila 9 months ago
Wait, does tr even handle spaces like that?
LA
Lashunda 9 months ago
I thought it was B at first, but E makes sense.
VE
Veronika 9 months ago
D) tr -r ' ' '\n' < a.txt > b.txt - Wait, what? Replacing spaces with newlines? That's just weird.
JE
Jess 10 months ago
Option E is the one. Trims those extra spaces like a boss.
JE
Jeannetta 10 months ago
E) tr -s ' ' < a.txt > b.txt is the way to go. Gotta love that space-squeezing power!
CA
Carole 10 months ago
I'm pretty sure it's E. Reducing consecutive spaces is what the -s option is for.
BO
Bobbye 10 months ago
E) tr -s ' ' < a.txt > b.txt is the correct answer.
BR
Brock 10 months ago
I’m confused about option B; I feel like it does something with characters but not specifically for spaces.
DO
Donte 10 months ago
I remember practicing with the `tr` command, and I feel like `-s` was mentioned for squeezing spaces.
PA
Patria 11 months ago
Easy peasy, the answer is E. The -s flag for "squeeze" is exactly what we need to collapse those consecutive spaces. Shouldn't be too hard to remember that one.
DA
Dalene 11 months ago
Ugh, these tr commands always get me a little confused. I'm leaning towards B or E, but I'm not 100% confident. Guess I'll have to carefully read through the options again.
NO
Noah 11 months ago
Alright, let's see here. I'm pretty sure the answer is E, the -s flag for "squeeze". That's the one that will reduce multiple spaces down to a single space, right? I feel good about that one.
CO
Corazon 11 months ago
Yeah, E is the right choice! It squeezes spaces.
EL
Elliott 11 months ago
Option E is the correct one!
RA
Rachael 11 months ago
I think option E is the one that reduces consecutive spaces, but I'm not entirely sure.
SI
Silva 12 months ago
I think it's E. It makes sense.
ST
Stephanie 12 months ago
I might be mixing it up, but I think `tr -d ' '` just deletes all spaces, not reduces them.
KE
Kenneth 1 year ago
Hmm, I'm not totally sure about this one. I was thinking maybe option C, which deletes all spaces, but that might be too aggressive. I'll have to think it through a bit more.
PA
Paris 1 year ago
I think option E is the way to go here. The -s flag in tr stands for "squeeze", which will collapse all consecutive spaces down to a single space.
TW
Twanna 7 months ago
↳ replying to Paris
Good catch on the squeeze flag!
PE
Penney 7 months ago
↳ replying to Paris
Option E is definitely the best choice here.
MI
Mike 7 months ago
↳ replying to Paris
I remember using that for cleaning text files.
FR
Frederica 7 months ago
↳ replying to Paris
Yes, the -s flag is perfect for this.
SO
Sophia 7 months ago
↳ replying to Paris
I agree, option E seems right.
0/2000 characters

Save Cancel