tr -s ' '

Category: Text Processing

tr -s ' '

Squeeze repeated spaces into a single space

Replaces multiple consecutive spaces with a single space. -s means 'squeeze repeated characters'.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.