{"id":1135,"date":"2020-05-19T20:32:08","date_gmt":"2020-05-19T20:32:08","guid":{"rendered":"https:\/\/jan.schnasse.org\/blog\/?p=1135"},"modified":"2026-09-28T11:38:46","modified_gmt":"2026-09-28T09:38:46","slug":"bash-hacks-structured-printing-of-ls","status":"publish","type":"post","link":"https:\/\/jan.schnasse.org\/blog\/2020\/05\/19\/bash-hacks-structured-printing-of-ls\/","title":{"rendered":"Bash hacks. Structured directory listings."},"content":{"rendered":"<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$ lscsv -l \/etc\/profile |oi\u00a0-t\u00a0yaml -i csv --header \"type,perm,hlinks,user,group,size,modified,name\"\n---\ndata:\n- group: \"root\"\n  hlinks: \"1\"\n  modified: \"Sep 16  2019\"\n  name: \"\/etc\/profile\"\n  perm: \"rw-r--r--\"\n  size: \"902\"\n  type: \"-\"\n  user: \"root\"<\/pre>\n<p>With `lscsv` (<a href=\"https:\/\/gist.github.com\/jschnasse\/c320af2187e46c4aad1a8c19407fdd0c\">gist<\/a>)<br \/>\n<script src=\"https:\/\/gist.github.com\/jschnasse\/c320af2187e46c4aad1a8c19407fdd0c.js\"><\/script><br \/>\nand `oi` (<a href=\"https:\/\/github.com\/jschnasse\/oi\">java<\/a>)<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">wget https:\/\/schnasse.org\/deb\/oi_0.0.1.deb\nsudo apt install .\/oi_0.0.1.deb<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>$ lscsv -l \/etc\/profile |oi\u00a0-t\u00a0yaml -i csv &#8211;header &#8222;type,perm,hlinks,user,group,size,modified,name&#8220; &#8212; data: &#8211; group: &#8222;root&#8220; hlinks: &#8222;1&#8220; modified: &#8222;Sep 16 2019&#8220; name: &#8222;\/etc\/profile&#8220; perm: &#8222;rw-r&#8211;r&#8211;&#8220; size: &#8222;902&#8220; type: &#8222;-&#8220; user: &#8222;root&#8220; With `lscsv` (gist) and `oi` (java) wget https:\/\/schnasse.org\/deb\/oi_0.0.1.deb sudo apt install .\/oi_0.0.1.deb &nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,6],"tags":[],"class_list":["post-1135","post","type-post","status-publish","format-standard","hentry","category-admin","category-development"],"_links":{"self":[{"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/posts\/1135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/comments?post=1135"}],"version-history":[{"count":1,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/posts\/1135\/revisions"}],"predecessor-version":[{"id":4174,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/posts\/1135\/revisions\/4174"}],"wp:attachment":[{"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/media?parent=1135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/categories?post=1135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jan.schnasse.org\/blog\/wp-json\/wp\/v2\/tags?post=1135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}