{"id":309,"date":"2015-12-10T09:34:39","date_gmt":"2015-12-10T09:34:39","guid":{"rendered":"http:\/\/www.haxed.me.uk\/?p=309"},"modified":"2015-12-10T09:34:39","modified_gmt":"2015-12-10T09:34:39","slug":"determining-exact-disk-space-usage-on-a-linux-server","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2015\/12\/10\/determining-exact-disk-space-usage-on-a-linux-server\/","title":{"rendered":"Determining exact Disk space usage on a Linux Server"},"content":{"rendered":"<p>Thanks to my colleague Aaron, he deserves the credit for this, this nice little one-liner for determining largest directories usage on a Linux Server.<\/p>\n<p>Handy for customers having issues with running out of space and helping them identify unnecessary files, runaway logs, and other disk fillers.<\/p>\n<pre>\r\nFS='\/';resize;clear;date;df -h $FS; echo \"Largest Directories:\"; du -hcx --max-depth=2 $FS 2>\/dev\/null | grep [0-9]G | sort -grk 1 | head -15 ;echo \"Largest Files:\"; nice -n 19 find $FS -mount -type f -print0 2>\/dev\/null| xargs -0 du -k | sort -rnk1| head -n20 |awk -F'\\t' '{printf \"%8d MB\\t%s\\n\",($1\/1024),$NF}'\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Thanks to my colleague Aaron, he deserves the credit for this, this nice little one-liner for determining largest directories usage on a Linux Server. Handy for customers having issues with running out of space and helping them identify unnecessary files, &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2015\/12\/10\/determining-exact-disk-space-usage-on-a-linux-server\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/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":[1],"tags":[],"class_list":["post-309","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=309"}],"version-history":[{"count":1,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/309\/revisions"}],"predecessor-version":[{"id":310,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/309\/revisions\/310"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}