{"id":2657,"date":"2016-10-07T11:15:32","date_gmt":"2016-10-07T11:15:32","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=2657"},"modified":"2016-10-07T11:15:32","modified_gmt":"2016-10-07T11:15:32","slug":"disk-space","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/command-line\/file-system-command-line\/disk-space","title":{"rendered":"Disk Space"},"content":{"rendered":"<p>\n&nbsp;\n<\/p>\n<h4>\nUsed Space On&nbsp;Disk<br \/>\n<\/h4>\n<pre>\r\n<code>\r\ndf -h\r\n<\/code><\/pre>\n<h5>\nTo get the amount of free space&nbsp;on the disk as a single value in kB you can use this:<br \/>\n<\/h5>\n<p>\ndf -k \/tmp | tail -1 | awk &#39;{print $4}&#39;\n<\/p>\n<p>\nor in MB:\n<\/p>\n<pre>\r\n<code>\r\ndf -BM \/tmp | tail -1 | awk &#39;{print $4}&#39;\r\n<\/code><\/pre>\n<p>\n(info about this&nbsp;<a href=\"http:\/\/stackoverflow.com\/questions\/19703621\/get-free-disk-space-with-df-to-just-display-free-space-in-kb\">here<\/a>)\n<\/p>\n<h4>\nUsed Space Of Current Directory<br \/>\n<\/h4>\n<pre>\r\n<code>\r\ndu -sh \/*\r\n<\/code><\/pre>\n<h4>\nFull Disk!<br \/>\n<\/h4>\n<p>\nA few things you can do&#8230;\n<\/p>\n<p>\nRemove old compressed&nbsp;log files from the system:\n<\/p>\n<pre>\r\n<code>\r\nsudo rm -v \/var\/log\/*.gz\r\n<\/code><\/pre>\n<p>\nClean-Up Installation Packages &nbsp;.To remove partial packages, clean the cache, remove unused dependencies use:\n<\/p>\n<pre>\r\n<code>\r\nsudo apt-get autoclean\r\nsudo apt-get clean\r\nsudo apt-get autoremove\r\n<\/code><\/pre>\n<p>\n&nbsp;\n<\/p>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Used Space On&nbsp;Disk df -h To get the amount of free space&nbsp;on the disk as a single value in kB you can use this: df -k \/tmp | tail -1 | awk &#39;{print $4}&#39; or in MB: df -BM \/tmp | tail -1 | awk &#39;{print $4}&#39; (info about this&nbsp;here) Used Space Of Current [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[133],"tags":[],"class_list":["post-2657","post","type-post","status-publish","format-standard","hentry","category-file-system-command-line"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2657","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=2657"}],"version-history":[{"count":1,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2657\/revisions"}],"predecessor-version":[{"id":2658,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2657\/revisions\/2658"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=2657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=2657"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=2657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}