{"id":10835,"date":"2022-09-26T14:07:52","date_gmt":"2022-09-26T18:07:52","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=10835"},"modified":"2022-09-26T14:12:36","modified_gmt":"2022-09-26T18:12:36","slug":"the-rs-command","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=10835","title":{"rendered":"The <code>rs<\/code> Command"},"content":{"rendered":"<p>Dr Drang over at <a href=\"https:\/\/leancrew.com\">And now it\u2019s all this<\/a> has an <a href=\"https:\/\/leancrew.com\/all-this\/2022\/09\/reshaping-text\/\">interesting post on the Unix rs command<\/a> and his use case for it. The \u201crs\u201d stands for \u201creshape\u201d. The idea is that given some data arranged in rows and columns, <code>rs<\/code> will change the number of rows\u2014and therefore columns\u2014resulting in a change of \u201cshape\u201d of the data. The command is a bit obscure. I\u2019ve been using Unix since 1990 and don\u2019t remember ever coming across it much less using it.<\/p>\n<p>Still, as Dr. Drang shows, it can be really useful for reformatting data to better fit the space it lives in. Dr. Drang\u2019s use case is to insert a long list of numerical data into an email. The list was long so he didn\u2019t want to just paste it into the email because it would have made the email too long. Instead, he used <code>rs<\/code> to insert it as 14 rows of 6 columns, which made it fit nicely.<\/p>\n<p>The command is actually quite flexible and has many options. Dr. Drang demonstrates a couple of them that he used to make the data look better. Read the post for the details.<\/p>\n<p>It\u2019s interesting that this command is still around. Oddly, it\u2019s a macOS builtin, resulting, no doubt, from macOS\u2019s BSD heritage. I can\u2019t imagine it gets used all that much but when you need to change the shape of some data, it\u2019s just the thing.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dr Drang over at And now it\u2019s all this has an interesting post on the Unix rs command and his use case for it. The \u201crs\u201d stands for \u201creshape\u201d. The idea is that given some data arranged in rows and &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=10835\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[37,36],"class_list":["post-10835","post","type-post","status-publish","format-standard","hentry","category-general","tag-tech","tag-unix"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10835","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10835"}],"version-history":[{"count":2,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10835\/revisions"}],"predecessor-version":[{"id":10838,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10835\/revisions\/10838"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10835"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}