{"id":395,"date":"2018-08-19T21:05:21","date_gmt":"2018-08-19T21:05:21","guid":{"rendered":"https:\/\/alexrusin.com\/?p=395"},"modified":"2018-08-19T21:18:39","modified_gmt":"2018-08-19T21:18:39","slug":"check-available-space-on-ubuntu","status":"publish","type":"post","link":"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/","title":{"rendered":"Check Available Space on Ubuntu"},"content":{"rendered":"

\nRecently I got into a situation where I ran out of free space on my Ubuntu instance. The first thing you need to do is to check how much available space you have. The command below will give you the general idea.\n<\/p>\n

\r\ndf -h\r\n<\/pre>\n

<\/p>\n

\nTo list the files\/directories that take up most of the space use the following. You can make your system to show you more files by changing “-n 10” to “-n 20” etc.\n<\/p>\n

\r\nsudo du -a \/ | sort -n -r | head -n 10\r\n\r\n47286901        \/\r\n42315676        \/var\r\n41550196        \/var\/log\r\n41534640        \/var\/log\/jenkins\r\n28101588        \/var\/log\/jenkins\/jenkins.log\r\n13432208        \/var\/log\/jenkins\/jenkins.log.1\r\n2978220 \/home\r\n2978216 \/home\/deploy\r\n1589784 \/home\/deploy\/www\r\n1499948 \/usr\r\n<\/pre>\n

\nAnother command that will give you a good idea about the space allocated is:\n<\/p>\n

\r\nsudo du -cha --max-depth=1 \/var | grep -E \"M|G\"\r\n<\/pre>\n

\nYou can decide how deep to go by changing “–max-depth” value\n<\/p>\n

<\/p>\n

\nIn order to get a better visual representation and more user friendly interface, you can install ncdu – an Ubuntu disk usage viewer package\n<\/p>\n

\r\nsudo apt-get install ncdu\r\n<\/pre>\n

<\/p>\n

\nAfter you delete the files that take up all that space (in my situations those files were Jenkins log files), do not forget to reboot your Ubuntu instance.
\nFor more information on how to check available space from command line, please read this article:
\nhttps:\/\/www.techrepublic.com\/article\/how-to-check-drive-space-on-linux-from-the-command-line\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

Recently I got into a situation where I ran out of free space on my Ubuntu instance. The first thing you need to do is to check how much available space you have. The command below will give you the general idea. df -h To list the files\/directories that take up most of the space…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[9],"tags":[],"class_list":["post-395","post","type-post","status-publish","format-standard","hentry","category-system-administration"],"yoast_head":"\nCheck Available Space on Ubuntu | Alex Rusin Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Check Available Space on Ubuntu | Alex Rusin Blog\" \/>\n<meta property=\"og:description\" content=\"Recently I got into a situation where I ran out of free space on my Ubuntu instance. The first thing you need to do is to check how much available space you have. The command below will give you the general idea. df -h To list the files\/directories that take up most of the space...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Alex Rusin Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-19T21:05:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-08-19T21:18:39+00:00\" \/>\n<meta name=\"author\" content=\"alexrusin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"alexrusin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/\"},\"author\":{\"name\":\"alexrusin\",\"@id\":\"https:\/\/blog.alexrusin.com\/#\/schema\/person\/a9005ca622862109b2c514050fbaaf9a\"},\"headline\":\"Check Available Space on Ubuntu\",\"datePublished\":\"2018-08-19T21:05:21+00:00\",\"dateModified\":\"2018-08-19T21:18:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/\"},\"wordCount\":177,\"publisher\":{\"@id\":\"https:\/\/blog.alexrusin.com\/#\/schema\/person\/a9005ca622862109b2c514050fbaaf9a\"},\"articleSection\":[\"System Administration\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/\",\"url\":\"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/\",\"name\":\"Check Available Space on Ubuntu | Alex Rusin Blog\",\"isPartOf\":{\"@id\":\"https:\/\/blog.alexrusin.com\/#website\"},\"datePublished\":\"2018-08-19T21:05:21+00:00\",\"dateModified\":\"2018-08-19T21:18:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.alexrusin.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Check Available Space on Ubuntu\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.alexrusin.com\/#website\",\"url\":\"https:\/\/blog.alexrusin.com\/\",\"name\":\"Alex Rusin\",\"description\":\"Web Development Blog\",\"publisher\":{\"@id\":\"https:\/\/blog.alexrusin.com\/#\/schema\/person\/a9005ca622862109b2c514050fbaaf9a\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.alexrusin.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/blog.alexrusin.com\/#\/schema\/person\/a9005ca622862109b2c514050fbaaf9a\",\"name\":\"alexrusin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.alexrusin.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c36ef231f9e0b11371891eb84360f4bc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c36ef231f9e0b11371891eb84360f4bc?s=96&d=mm&r=g\",\"caption\":\"alexrusin\"},\"logo\":{\"@id\":\"https:\/\/blog.alexrusin.com\/#\/schema\/person\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Check Available Space on Ubuntu | Alex Rusin Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"Check Available Space on Ubuntu | Alex Rusin Blog","og_description":"Recently I got into a situation where I ran out of free space on my Ubuntu instance. The first thing you need to do is to check how much available space you have. The command below will give you the general idea. df -h To list the files\/directories that take up most of the space...","og_url":"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/","og_site_name":"Alex Rusin Blog","article_published_time":"2018-08-19T21:05:21+00:00","article_modified_time":"2018-08-19T21:18:39+00:00","author":"alexrusin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"alexrusin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/#article","isPartOf":{"@id":"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/"},"author":{"name":"alexrusin","@id":"https:\/\/blog.alexrusin.com\/#\/schema\/person\/a9005ca622862109b2c514050fbaaf9a"},"headline":"Check Available Space on Ubuntu","datePublished":"2018-08-19T21:05:21+00:00","dateModified":"2018-08-19T21:18:39+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/"},"wordCount":177,"publisher":{"@id":"https:\/\/blog.alexrusin.com\/#\/schema\/person\/a9005ca622862109b2c514050fbaaf9a"},"articleSection":["System Administration"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/","url":"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/","name":"Check Available Space on Ubuntu | Alex Rusin Blog","isPartOf":{"@id":"https:\/\/blog.alexrusin.com\/#website"},"datePublished":"2018-08-19T21:05:21+00:00","dateModified":"2018-08-19T21:18:39+00:00","breadcrumb":{"@id":"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.alexrusin.com\/check-available-space-on-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.alexrusin.com\/"},{"@type":"ListItem","position":2,"name":"Check Available Space on Ubuntu"}]},{"@type":"WebSite","@id":"https:\/\/blog.alexrusin.com\/#website","url":"https:\/\/blog.alexrusin.com\/","name":"Alex Rusin","description":"Web Development Blog","publisher":{"@id":"https:\/\/blog.alexrusin.com\/#\/schema\/person\/a9005ca622862109b2c514050fbaaf9a"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.alexrusin.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/blog.alexrusin.com\/#\/schema\/person\/a9005ca622862109b2c514050fbaaf9a","name":"alexrusin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.alexrusin.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c36ef231f9e0b11371891eb84360f4bc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c36ef231f9e0b11371891eb84360f4bc?s=96&d=mm&r=g","caption":"alexrusin"},"logo":{"@id":"https:\/\/blog.alexrusin.com\/#\/schema\/person\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/posts\/395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/comments?post=395"}],"version-history":[{"count":10,"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/posts\/395\/revisions"}],"predecessor-version":[{"id":430,"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/posts\/395\/revisions\/430"}],"wp:attachment":[{"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/media?parent=395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/categories?post=395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.alexrusin.com\/wp-json\/wp\/v2\/tags?post=395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}