101-400 Exam QuestionsBrowse all questions from this exam

101-400 Exam - Question 69


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

Show Answer
Correct Answer: E

The command that will reduce all consecutive spaces down to a single space is tr -s ' ' < a.txt > b.txt. The -s option in the tr command squeezes consecutive spaces into a single space, effectively eliminating duplicate spaces in the input file a.txt and saving the result to b.txt.

Discussion

1 comment
Sign in to comment
DuboisNicolasDuclairOption: E
Oct 21, 2023

The command that will reduce all consecutive spaces down to a single space is: E. `tr -s ' ' < a.txt > b.txt` The `-s` option in the `tr` command squeezes (or reduces) consecutive spaces into a single space, effectively eliminating duplicate spaces in the input file `a.txt` and saving the result to `b.txt`.