Linux Foundation Certified System Administrator (LFCS) — Question 81

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

Answer options

Correct answer: E

Explanation

The correct answer is E because the '-s' option in the 'tr' command is specifically designed to squeeze multiple consecutive spaces into a single space. The other options do not achieve this result: A and C modify spaces incorrectly, B complements the characters but doesn't reduce spaces, and D replaces spaces with newlines instead.