{"id":579,"date":"2013-02-21T19:10:16","date_gmt":"2013-02-21T19:10:16","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2013\/02\/21\/check-disk-space-through-shell\/"},"modified":"2024-09-25T12:23:12","modified_gmt":"2024-09-25T16:23:12","slug":"check-disk-space-through-shell","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/","title":{"rendered":"How to find what is using the most disk space on my server"},"content":{"rendered":"\n<p>If you notice you are not able to connect to your cPanel, Webmail, or WHM and your website is slow and giving errors, your server may be maxed out on the disk space. A common error you may see is like the following when going to your cPanel.<\/p>\n\n\n\n<figure class=\"wp-block-pullquote\"><blockquote><p>Sorry for the inconvenience! The filesystem mounted at \/ on this server is running out of disk space. cPanel operations have been temporarily suspended to prevent something bad from happening. Please ask your system admin to remove any files not in use on that partition.<\/p><\/blockquote><\/figure>\n\n\n\n<p class=\"alert alert-warning\"><strong>Important!<\/strong> This is for <a href=\"https:\/\/www.inmotionhosting.com\/vps-hosting\">VPS<\/a> or Dedicated server customers only. If you are getting this error and you are not on a VPS or a Dedicated server, you will need to contact <a title=\"Click here for how to contact support\" href=\"\/support\/amp\/how-to-get-great-technical-support\/\" target=\"_blank\" rel=\"noopener noreferrer\">tech support<\/a> to have our systems support check the server disk space.<\/p>\n\n\n\n<p>You can <strong>check your Disk space usage<\/strong> through <a href=\"\/support\/server\/ssh\/how-to-login-ssh\/\" target=\"_blank\" rel=\"noopener noreferrer\">shell<\/a> or you can <a href=\"\/support\/edu\/whm\/view-bandwidth-and-disk-usage\/\" target=\"_blank\" rel=\"noopener noreferrer\">check the disk space through the WHM<\/a>. The purpose of this article is to show you how to check the disk space through shell.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to view your overall disk size and usage<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Checking disk space through Shell<\/h3>\n\n\n\n<p>You can check your disk space usage through the Shell Command line by typing the following command in your shell client.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted cli\">df -h<\/pre>\n\n\n\n<p>You will get a similar to the following output.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted cli\">root@vps#### [~]# df  -h Filesystem            Size  Used Avail Use% Mounted on \/dev\/vzfs              39G   38G  858M  98% \/ none                  512M  4.0K  512M   1% \/dev<\/pre>\n\n\n\n<p>This Output shows that out of the 39 gigs of total disk space, 38 gigs are used with 858mb of space left over. This leaves the server at 98% disk space. This is enough to cause cPanel login failures, FTP file upload errors, and slow website issues. At this point you will need to remove some of the files from the server to bring the server back to normal operation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Using the Web Host Manager<\/h3>\n\n\n\n<p>If you are not familiar with using command line, you can look at your disk space usage through the WHM . The WHM will show you the accounts with the highest usage. For more information on checking your Disk space through WHM, see our article on <a href=\"\/support\/edu\/whm\/view-bandwidth-and-disk-usage\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to Monitor Disk Space and Bandwidth Usage in WHM<\/a>. Unfortunately, you cannot remove files through the WHM, you will need to access the cPanel <a title=\"Click here for info\" href=\"\/support\/edu\/cpanel\/using-file-manager-in-cpanel\/\" target=\"_blank\" rel=\"noopener noreferrer\">File Manager<\/a> for the account that has the large disk space usage and remove the files \/ folder through File manager.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to find files with a certain size<\/h2>\n\n\n\n<p>There are two commands you can use to check which folder files are taking up your disk space. You can use the &#8220;<em>find<\/em>&#8221; or the &#8220;<em>du<\/em>&#8221; command. Below explains the two commands you can use.<\/p>\n\n\n\n<p class=\"alert alert-warning\"><strong>Important!<\/strong> You must have permission to access the files you are searching for. If not you will get permissions errors.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Finding all file sizes with the &#8220;<em>du<\/em>&#8221; command<\/h3>\n\n\n\n<p>The following command will display all files and folders sorted by MegaBytes.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted cli\">du --max-depth=1 | sort -n | awk 'BEGIN {OFMT = \"%.0f\"} {print $1\/<span style=\"color: #ff0000;\"><strong>1024<\/strong><\/span>,\"MB\", $2}'<\/pre>\n\n\n\n<p>You should see an output of all your folders with the size of them in megabytes similar to the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted cli\">0 MB .\/.htpasswds 0 MB .\/.trash 0 MB .\/public_ftp 0 MB .\/etc 0 MB .\/.fontconfig 0 MB .\/.cpanel 0 MB .\/mail 4 MB .\/tmp 1173 MB .\/public_html 1224 MB .<\/pre>\n\n\n\n<p>This output shows that all files over 1 MB are in the <strong>\/public_html<\/strong>. You can run this command on a directory basis to find folders that are large. Also, this command can be customized to refne your search.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Finding specific file sizes using the &#8220;<em>find<\/em>&#8221; command<\/h3>\n\n\n\n<p>Below is the &#8220;<em>find<\/em>&#8220;command that looks for specific files in the &#8220;<em>home<\/em>&#8221; directory. The following script is finding files that are <span style=\"color: #ff0000;\">500000k<\/span> or larger<\/p>\n\n\n\n<pre class=\"wp-block-preformatted cli\">find \/home -type f -size +<span style=\"color: #ff0000;\">500M<\/span> -exec du -h {} \\;<\/pre>\n\n\n\n<p>The previous command will output a similar result like the following.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted cli\">\/home\/userna5\/public_html\/error_log: 514M \/home\/userna5\/backup-userna5.tar.gz: 738M<\/pre>\n\n\n\n<p>Here you can see that there is a backup that is 738MB large. You can find your backup files that are no longer needed and remove them to free up space.<\/p>\n\n\n\n<p>If you cannot fix the disk space issue on your server, you can have <a title=\"Click here for how to contact support\" href=\"\/support\/amp\/how-to-get-great-technical-support\/\" target=\"_blank\" rel=\"noopener noreferrer\">tech support<\/a> look into the matter for you. If you do not have any space to free up and cannot find files to remove, you can always <a href=\"\/support\/amp\/upgrade-downgrade-hosting-plan\/\" target=\"_blank\" rel=\"noopener noreferrer\">upgrade your hosting plan<\/a> to a plan with a larger disk.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you notice you are not able to connect to your cPanel, Webmail, or WHM and your website is slow and giving errors, your server may be maxed out on the disk space. A common error you may see is like the following when going to your cPanel. Sorry for the inconvenience! The filesystem mounted<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/\"> Read More ><\/a><\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4364],"tags":[],"class_list":["post-579","post","type-post","status-publish","format-standard","hentry","category-server-usage"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to find what is using the most disk space on my server | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"If you are running into disk space errors and you are on a VPS or Dedicated server, you can use the find or du command to check your disk space and find large files. This article explains how to check your server disk space through shell.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to find what is using the most disk space on my server | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"If you are running into disk space errors and you are on a VPS or Dedicated server, you can use the find or du command to check your disk space and find large files. This article explains how to check your server disk space through shell.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2013-02-21T19:10:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-25T16:23:12+00:00\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/0ba9f3ef6fadef71df5aa120ff996c41\"},\"headline\":\"How to find what is using the most disk space on my server\",\"datePublished\":\"2013-02-21T19:10:16+00:00\",\"dateModified\":\"2024-09-25T16:23:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/\"},\"wordCount\":659,\"commentCount\":15,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Server Usage\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/\",\"name\":\"How to find what is using the most disk space on my server | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2013-02-21T19:10:16+00:00\",\"dateModified\":\"2024-09-25T16:23:12+00:00\",\"description\":\"If you are running into disk space errors and you are on a VPS or Dedicated server, you can use the find or du command to check your disk space and find large files. This article explains how to check your server disk space through shell.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to find what is using the most disk space on my server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/0ba9f3ef6fadef71df5aa120ff996c41\",\"name\":\"InMotion Hosting Contributor\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/jamesr\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to find what is using the most disk space on my server | InMotion Hosting","description":"If you are running into disk space errors and you are on a VPS or Dedicated server, you can use the find or du command to check your disk space and find large files. This article explains how to check your server disk space through shell.","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:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/","og_locale":"en_US","og_type":"article","og_title":"How to find what is using the most disk space on my server | InMotion Hosting","og_description":"If you are running into disk space errors and you are on a VPS or Dedicated server, you can use the find or du command to check your disk space and find large files. This article explains how to check your server disk space through shell.","og_url":"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2013-02-21T19:10:16+00:00","article_modified_time":"2024-09-25T16:23:12+00:00","author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/0ba9f3ef6fadef71df5aa120ff996c41"},"headline":"How to find what is using the most disk space on my server","datePublished":"2013-02-21T19:10:16+00:00","dateModified":"2024-09-25T16:23:12+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/"},"wordCount":659,"commentCount":15,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Server Usage"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/","url":"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/","name":"How to find what is using the most disk space on my server | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2013-02-21T19:10:16+00:00","dateModified":"2024-09-25T16:23:12+00:00","description":"If you are running into disk space errors and you are on a VPS or Dedicated server, you can use the find or du command to check your disk space and find large files. This article explains how to check your server disk space through shell.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/check-disk-space-through-shell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to find what is using the most disk space on my server"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/0ba9f3ef6fadef71df5aa120ff996c41","name":"InMotion Hosting Contributor","url":"https:\/\/www.inmotionhosting.com\/support\/author\/jamesr\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":4364,"name":"Server Usage","slug":"server-usage","link":"https:\/\/www.inmotionhosting.com\/support\/server\/server-usage\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/579","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=579"}],"version-history":[{"count":5,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/579\/revisions"}],"predecessor-version":[{"id":128701,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/579\/revisions\/128701"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}