My sed-fu was deficient I guess (or my sed was) so I fell back to perl: If you want word-case perl -pe 's/ \b (\w) ([^\s]+) \b /\1\L\2/gx' # ONE COMPANY -> One Company (rather than One company)