Compress Whitespace With tr Shell Command

To replace all whitespace with single spaces pipe the text through:

tr -s [[:space:]] " "
  • ultrasawblade

    Yes!!! Exactly what I needed to parse some of ls’s output. Thank you VERY much.

blog comments powered by Disqus