{"id":405,"date":"2013-07-17T09:23:13","date_gmt":"2013-07-17T16:23:13","guid":{"rendered":"http:\/\/blog.ls-al.com\/?p=405"},"modified":"2013-07-17T09:23:13","modified_gmt":"2013-07-17T16:23:13","slug":"aix-with-no-human-readable-ls","status":"publish","type":"post","link":"https:\/\/blog.ls-al.com\/aix-with-no-human-readable-ls\/","title":{"rendered":"AIX with no human readable ls"},"content":{"rendered":"

I recently had to touch a pretty old AIX OS and it frustrated me not to have human readable output for ls. This function helped a little. An alias did not want to work because of all the quoting going on. Of course as you can notice I changed my shell prior to bash.<\/p>\n

\r\n> oslevel -g\r\nFileset                                 Actual Level        Maintenance Level\r\n-----------------------------------------------------------------------------\r\nbos.rte                                 5.3.7.0             5.3.0.0\r\n\r\n> more .profile\r\n...\r\nfunction ls-h() {\r\n  \/usr\/bin\/ls -l "$@" | awk "{\\$5=sprintf(\\"%.2f GB\\", \\$5\/1024^3)} 1";\r\n}\r\n...\r\nPATH=\/usr\/bin:\/etc:\/usr\/sbin:\/usr\/ucb:$HOME\/bin:\/usr\/bin\/X11:\/sbin:.\r\nexport PATH\r\n\r\n# alias has to many """ chars to work trying function ls-h\r\n#alias lsh "ls -l \\$@ | awk '{$5=sprintf("%.2f GB", $5\/1024^3)} 1'"\r\n\r\n> ls-h \/u28\/oracle\/uat2data\/\r\ntotal 830472432   0.00 GB\r\n-rw-r----- 1 ora dba 31.00 GB Jul 14 00:46 a_ora_file.dbf\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

I recently had to touch a pretty old AIX OS and it frustrated me not to have human readable output<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"class_list":["post-405","post","type-post","status-publish","format-standard","hentry","category-aix"],"_links":{"self":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/405","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/comments?post=405"}],"version-history":[{"count":0,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/405\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/media?parent=405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/categories?post=405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/tags?post=405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}