Use the above command
This is used to squeeze the repeated space character into a single character.
So repeated space character will become as single space.
And it wont affect the single space.
Example:
echo "My Name is test test2 test3 test4 test5" | tr -s ' '