New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

LPI 101-500 Exam - Topic 3 Question 119 Discussion

Actual exam question for LPI's 101-500 exam
Question #: 119
Topic #: 3
[All 101-500 Questions]

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

Show Suggested Answer Hide Answer
Suggested Answer: E

Contribute your Thoughts:

0/2000 characters
Leila
8 hours ago
Wait, does tr even handle spaces like that?
upvoted 0 times
...
Lashunda
5 days ago
I thought it was B at first, but E makes sense.
upvoted 0 times
...
Veronika
11 days ago
D) tr -r ' ' '\n' < a.txt > b.txt - Wait, what? Replacing spaces with newlines? That's just weird.
upvoted 0 times
...
Jess
16 days ago
Option E is the one. Trims those extra spaces like a boss.
upvoted 0 times
...
Jeannetta
21 days ago
E) tr -s ' ' < a.txt > b.txt is the way to go. Gotta love that space-squeezing power!
upvoted 0 times
...
Carole
26 days ago
I'm pretty sure it's E. Reducing consecutive spaces is what the -s option is for.
upvoted 0 times
...
Bobbye
1 month ago
E) tr -s ' ' < a.txt > b.txt is the correct answer.
upvoted 0 times
...
Brock
1 month ago
I’m confused about option B; I feel like it does something with characters but not specifically for spaces.
upvoted 0 times
...
Donte
1 month ago
I remember practicing with the `tr` command, and I feel like `-s` was mentioned for squeezing spaces.
upvoted 0 times
...
Patria
2 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.
upvoted 0 times
...
Dalene
2 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.
upvoted 0 times
...
Noah
2 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.
upvoted 0 times
...
Corazon
2 months ago
Yeah, E is the right choice! It squeezes spaces.
upvoted 0 times
...
Elliott
2 months ago
Option E is the correct one!
upvoted 0 times
...
Rachael
2 months ago
I think option E is the one that reduces consecutive spaces, but I'm not entirely sure.
upvoted 0 times
...
Silva
3 months ago
I think it's E. It makes sense.
upvoted 0 times
...
Stephanie
3 months ago
I might be mixing it up, but I think `tr -d ' '` just deletes all spaces, not reduces them.
upvoted 0 times
...
Kenneth
3 months 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.
upvoted 0 times
...
Paris
3 months 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.
upvoted 0 times
...

Save Cancel