On X-based systems, xsel -ob | sort | xsel -ib<p>But if you're in a high-octane development environment like vi, there's no need to resort to a separate terminal window to invoke 'sort clipboard'. just mark a range of lines (v) then :!sort to filter through good old unix sort.
This is a trivial but super useful hack. The way you use it is:<p>1. You're in an edit field in any old app - browser, Atom, vi<p>2. Select lines to sort and ^c<p>3. alt+tab to command line<p>4. pbsort<p>5. alt+tab back to app<p>6. ^v