{"id":9,"date":"2007-08-07T20:19:21","date_gmt":"2007-08-07T12:19:21","guid":{"rendered":"http:\/\/www.sysadmindayph.com\/blog\/?p=9"},"modified":"2012-02-11T18:46:53","modified_gmt":"2012-02-11T10:46:53","slug":"from-dusk","status":"publish","type":"post","link":"https:\/\/www.sysadmindayph.com\/blog\/from-dusk\/","title":{"rendered":"from DUSK&#8230;"},"content":{"rendered":"<p>We UNIX SysAds have many many tools that can  help us administer our servers. What&#8217;s great about UNIX is that you don&#8217;t have to learn the complicated commands to do what&#8217;s need to be done.<br \/>\n<script type=\"text\/javascript\"><!--\ngoogle_ad_client = \"ca-pub-8839128323193448\";\n\/* sysadmin-bigsquare *\/\ngoogle_ad_slot = \"0154488356\";\ngoogle_ad_width = 336;\ngoogle_ad_height = 280;\n\/\/-->\n<\/script><br \/>\n<script type=\"text\/javascript\"\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\n<\/script><br \/>\nThere is a saying in the UNIX world that a complex command is just a few commands used altogether.  We usually apply pipes on these stuff.<\/p>\n<p>Let&#8217;s take DUSK for example&#8230; or it can really be DUCKS depending on what version of DU you use.<\/p>\n<p>DUSK is what I use very often every time I want to know the disk usage of the current file systems and the sub directories under that.<\/p>\n<p>The command,<\/p>\n<blockquote><p>du -sk * | sort -n | more<\/p><\/blockquote>\n<p>does exactly that.  And here&#8217;s the output when executed my home directory.<\/p>\n<blockquote><p>bash-2.05# du -sk * | sort -rn | more<br \/>\n4409    nrpe<br \/>\n4263    tmp<br \/>\n3399    xilinx<br \/>\n1048    dl4.files<br \/>\n465     unixstuff<br \/>\n244     scripts<br \/>\n30      hosts<br \/>\n7       doy<br \/>\n6       list.tqs.032206<br \/>\n4       LICENSE.TXT<br \/>\n2       help<br \/>\n1       netapp<br \/>\n1       hp84k.NIS<\/p><\/blockquote>\n<p>As you can see, it listed all the size of the files and the directories. This is a useful command specially if you&#8217;re looking for the disk space hog on you filesystem.<br \/>\n<script type=\"text\/javascript\"><!--\ngoogle_ad_client = \"ca-pub-8839128323193448\";\n\/* sysadmin-bigsquare *\/\ngoogle_ad_slot = \"0154488356\";\ngoogle_ad_width = 336;\ngoogle_ad_height = 280;\n\/\/-->\n<\/script><br \/>\n<script type=\"text\/javascript\"\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\n<\/script><br \/>\nBut why use such long command when you can use &#8216;dusk&#8217; ? I don&#8217;t know about you but &#8216;du -sk * | sort -rn | more&#8217; is a <span style=\"font-style: italic\">mouthful<\/span> than &#8216;dusk&#8217; right?<\/p>\n<p>Here&#8217;s what you do: Simply create and alias for that command and assigned it to &#8216;dusk&#8217; and you&#8217;re done.<\/p>\n<p>bash:<\/p>\n<p># alias dusk=&#8217;du -sk * | sort -rn | more&#8217;<\/p>\n<p>csh<\/p>\n<p>% set dusk= du -sk * | sort -rn | more<\/p>\n<p>Try it. It will save you tones of typing errors! \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We UNIX SysAds have many many tools that can help us administer our servers. What&#8217;s great about UNIX is that you don&#8217;t have to learn the complicated commands to do what&#8217;s need to be done. &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,8,3],"tags":[],"class_list":["post-9","post","type-post","status-publish","format-standard","hentry","category-linux","category-tips","category-unix"],"_links":{"self":[{"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/comments?post=9"}],"version-history":[{"count":1,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts\/9\/revisions"}],"predecessor-version":[{"id":301,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts\/9\/revisions\/301"}],"wp:attachment":[{"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/media?parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/categories?post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/tags?post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}