Compress Whitespace With tr Shell Command By admin on December 11, 2009 in Misc To replace all whitespace with single spaces pipe the text through: tr -s [[:space:]] " " 1 tr -s [[:space:]] " " Related posts: Zimbra – Set MTA Trusted Networks From Command Line