{"id":1393,"date":"2018-11-26T07:35:22","date_gmt":"2018-11-26T13:35:22","guid":{"rendered":"http:\/\/bateru.com\/news\/?p=1393"},"modified":"2018-11-25T22:28:09","modified_gmt":"2018-11-26T04:28:09","slug":"dev-tip-sort-content-in-clipboard-on-macos-linux","status":"publish","type":"post","link":"https:\/\/bateru.com\/news\/2018\/11\/dev-tip-sort-content-in-clipboard-on-macos-linux\/","title":{"rendered":"Dev Tip: Sort content in clipboard on MacOs &#038; Linux"},"content":{"rendered":"<p>Run this in your terminal to sort the text in your clipboard<\/p>\n<p><code><\/p>\n<pre lang=\"bash\">pbpaste | sort | pbcopy<\/pre>\n<p><\/code><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/bateru.com\/news\/wp-content\/uploads\/2018\/06\/sorting_is_easy.gif\" alt=\"\" width=\"455\" height=\"235\" class=\"aligncenter size-full wp-image-1702\" \/><\/p>\n<p>Use `sort -n` to sort lines beginning with numbers.<br \/>\n<code><\/p>\n<pre lang=\"bash\">pbpaste | sort -n | pbcopy<\/pre>\n<p><\/code><\/p>\n<p>Code Break Down:<br \/>\n`pbpaste` paste the clipboard content into the standard input.<br \/>\n`sort` sorts the standard input.<br \/>\n`pbcopy` copies what comes from the standard output.<\/p>\n<p>Run `man sort` to fine out more about the sorting options.<\/p>\n<p>In Linux, you can add support for `pbpaste` and `pbcopy` by adding aliases commands to `xclip` in your ~\/.bash_rc.<br \/>\nMore information <a href=\"\nhttps:\/\/superuser.com\/questions\/288320\/whats-like-osxs-pbcopy-for-linux\">here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Run this in your terminal to sort the text in your clipboard pbpaste | sort | pbcopy Use `sort -n` to sort lines beginning with numbers. pbpaste | sort -n | pbcopy Code Break Down: `pbpaste` paste the clipboard content into the standard input. `sort` sorts the standard input. `pbcopy` copies what comes from the &hellip; <a href=\"https:\/\/bateru.com\/news\/2018\/11\/dev-tip-sort-content-in-clipboard-on-macos-linux\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Dev Tip: Sort content in clipboard on MacOs &#038; Linux<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[245,190,10],"tags":[195,339,340,337,338],"class_list":["post-1393","post","type-post","status-publish","format-standard","hentry","category-programming","category-tech","category-tutorials","tag-macos","tag-pbcopy","tag-pbpaste","tag-sorting","tag-terminal"],"_links":{"self":[{"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/posts\/1393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/comments?post=1393"}],"version-history":[{"count":4,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/posts\/1393\/revisions"}],"predecessor-version":[{"id":1704,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/posts\/1393\/revisions\/1704"}],"wp:attachment":[{"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/media?parent=1393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/categories?post=1393"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/tags?post=1393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}