{"id":698,"date":"2016-11-24T00:00:00","date_gmt":"2016-11-24T00:00:00","guid":{"rendered":"http:\/\/blog.hostinger.io\/hostinger-tutorials\/uncategorized\/vpshow-to-check-and-manage-disk-space-via-terminal\/"},"modified":"2026-09-03T13:18:22","modified_gmt":"2026-09-03T13:18:22","slug":"how-to-check-disk-space-in-linux","status":"publish","type":"post","link":"\/ph\/tutorials\/how-to-check-disk-space-in-linux","title":{"rendered":"How to check disk space in Linux using df and du"},"content":{"rendered":"<p class=\"wp-block-paragraph\">To check disk space in Linux, run the <code>df -h<\/code> command. It shows the total, used, and available space for each mounted filesystem in an easy-to-read format.<\/p><p class=\"wp-block-paragraph\">If you need to find what is taking up that space, use the <code>du<\/code> command to check the size of specific directories and files. In this tutorial, you&rsquo;ll learn how to use <code>df<\/code> and <code>du<\/code> to check Linux disk usage, find large files and directories, and troubleshoot common disk space issues.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Linux-Commands-Cheat-Sheet.pdf\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" width=\"2048\" height=\"566\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-69262\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/11\/Linux-cheat-sheet.png 2048w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/11\/Linux-cheat-sheet-300x83.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/11\/Linux-cheat-sheet-1536x425.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/11\/Linux-cheat-sheet-150x41.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/11\/Linux-cheat-sheet-768x212.png 768w\" sizes=\"(max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure>\n<\/div><p>\n\n\n\n<\/p><h2 id=\"h-how-to-check-disk-space-in-linux\" class=\"wp-block-heading\">How to check disk space in Linux<\/h2><p class=\"wp-block-paragraph\">To check disk space in Linux, open a terminal and run the <code>df -h<\/code> command. If you manage a remote server, connect to it using <a href=\"\/ph\/tutorials\/basic-ssh-commands\/\">SSH<\/a> first.<\/p><p class=\"wp-block-paragraph\">The following methods show how to check available filesystem space, measure directory usage, and identify what is consuming storage using common <a href=\"\/ph\/tutorials\/linux-commands\/\">Linux commands<\/a>. We&rsquo;ll also explain how <a href=\"\/ph\/vps-hosting\">Hostinger VPS<\/a> users can check disk usage directly from hPanel.<\/p><h3 class=\"wp-block-heading\">How to check disk space in Linux using the df command<\/h3><p class=\"wp-block-paragraph\">The <code>df -h<\/code> command is the simplest way to check total, used, and available disk space on Linux filesystems.<\/p><p class=\"wp-block-paragraph\">Run:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">df -h<\/pre><p class=\"wp-block-paragraph\">The <code>-h<\/code> option displays storage sizes in a human-readable format, such as MB and GB. The output will look similar to this:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Filesystem      Size  Used Avail Use% Mounted on\n\/dev\/sda1       100G   60G   40G  60% \/\ntmpfs           1.9G  1.2M  1.9G   1% \/dev\/shm\n\/dev\/sda2       200G  100G  100G  50% \/home<\/pre><p class=\"wp-block-paragraph\">Here&rsquo;s what each column means:<\/p><ul class=\"wp-block-list\">\n<li><strong>Filesystem<\/strong> &ndash; the filesystem or storage device.<\/li>\n\n\n\n<li><strong>Size<\/strong> &ndash; its total capacity.<\/li>\n\n\n\n<li><strong>Used<\/strong> &ndash; the amount of storage currently in use.<\/li>\n\n\n\n<li><strong>Avail<\/strong> &ndash; the space available for new data.<\/li>\n\n\n\n<li><strong>Use%<\/strong> &ndash; the percentage of storage being used.<\/li>\n\n\n\n<li><strong>Mounted on<\/strong> &ndash; the directory where the filesystem is mounted.<\/li>\n<\/ul><p class=\"wp-block-paragraph\">Pay particular attention to <strong>Use%<\/strong> and <strong>Mounted on<\/strong>. They show which filesystem is running low on space and where it is mounted.<\/p><p class=\"wp-block-paragraph\">You can also use <code>df<\/code> to check more specific information:<\/p><ul class=\"wp-block-list\">\n<li><code>df -h \/<\/code> &ndash; check disk space for the filesystem containing the root directory.<\/li>\n\n\n\n<li><code>df -h \/home<\/code> &ndash; check the filesystem containing a specific directory.<\/li>\n\n\n\n<li><code>df -hT<\/code> &ndash; show disk usage together with filesystem types, such as ext4 or xfs.<\/li>\n\n\n\n<li><code>df -ih<\/code> &ndash; check inode usage instead of storage capacity.<\/li>\n<\/ul><p class=\"wp-block-paragraph\">For example, if you only want to check the filesystem containing the root directory, run:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">df -h \/<\/pre><p class=\"wp-block-paragraph\">Once you identify a filesystem that is nearly full, use the <code>du<\/code> command to determine which directories are consuming its space.<\/p><h3 class=\"wp-block-heading\">How to check directory disk usage with the du command<\/h3><p class=\"wp-block-paragraph\">The <code>du<\/code> command shows how much disk space a file or directory uses, making it useful for finding what is consuming storage on a full filesystem.<\/p><p class=\"wp-block-paragraph\">To check the total size of a directory, run:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">du -sh \/path\/to\/directory<\/pre><p class=\"wp-block-paragraph\">For example, to check the size of the <code>\/var<\/code> directory:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">du -sh \/var<\/pre><p class=\"wp-block-paragraph\">The <code>-s<\/code> option displays only the total size, while <code>-h<\/code> formats it in readable units such as MB and GB.<\/p><p class=\"wp-block-paragraph\">To compare the size of directories one level below a location, use:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo du -h --max-depth=1 \/var<\/pre><p class=\"wp-block-paragraph\">The output may look like this:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">4.0K    \/var\/local\n180M    \/var\/log\n1.2G    \/var\/cache\n3.8G    \/var\/lib\n5.2G    \/var<\/pre><p class=\"wp-block-paragraph\">This makes it easier to identify which directory you should investigate further.<\/p><p class=\"wp-block-paragraph\">Unlike <code>df<\/code>, which shows available and used space for entire filesystems, <code>du<\/code> measures the space consumed by specific files and directories. Use <code>df -h<\/code> first to locate a nearly full filesystem, then use <code>du<\/code> to find where its storage is being used.<\/p><h3 class=\"wp-block-heading\">How to check disk usage with ncdu<\/h3><p class=\"wp-block-paragraph\">The <code>ncdu<\/code> utility provides an interactive way to browse directories and identify what is using disk space.<\/p><p class=\"wp-block-paragraph\">Unlike <code>du<\/code>, which prints results directly in the terminal, <code>ncdu<\/code> lets you navigate through directories and sort items by size.<\/p><p class=\"wp-block-paragraph\">Install it using your distribution&rsquo;s package manager. On Ubuntu or Debian, run:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt install ncdu<\/pre><p class=\"wp-block-paragraph\">Then scan a directory:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ncdu \/var<\/pre><p class=\"wp-block-paragraph\">To scan the root filesystem while staying on the same filesystem, run:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo ncdu -x \/<\/pre><p class=\"wp-block-paragraph\">Use the arrow keys to move through directories and press <strong>Enter<\/strong> to open the selected directory. This makes <code>ncdu<\/code> useful when you want to explore disk usage interactively instead of running multiple <code>du<\/code> commands.<\/p><p class=\"wp-block-paragraph\">For a quick disk-space check, use <code>df -h<\/code> first. Use <code>ncdu<\/code> when you need an easier way to investigate which directories and files are consuming that space.<\/p><h3 class=\"wp-block-heading\">How to check disks and partitions with lsblk<\/h3><p class=\"wp-block-paragraph\">The <code>lsblk<\/code> command shows the block devices connected to your Linux system, including disks, partitions, and their mount points.<\/p><p class=\"wp-block-paragraph\">Run:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">lsblk<\/pre><p class=\"wp-block-paragraph\">The output may look like this:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS\nsda      8:0    0   100G  0 disk\n&#9500;&#9472;sda1   8:1    0    99G  0 part \/\n&#9492;&#9472;sda2   8:2    0     1G  0 part \/boot<\/pre><p class=\"wp-block-paragraph\">The <strong>SIZE<\/strong> column shows the capacity of each device or partition, while <strong>MOUNTPOINTS<\/strong> shows where it is mounted.<\/p><p class=\"wp-block-paragraph\">Use <code>lsblk<\/code> when you need to identify available disks or understand how storage is partitioned. To check how much free space a mounted filesystem has, use <code>df -h<\/code> instead.<\/p><h3 id=\"h-how-to-check-disk-space-in-hostinger-vps\" class=\"wp-block-heading\">How to check disk space in Hostinger VPS<\/h3><p class=\"wp-block-paragraph\">Hostinger VPS users can check disk usage from hPanel without running Linux commands.<\/p><ol class=\"wp-block-list\">\n<li>Log in to hPanel with your Hostinger account and go to <strong>VPS &rarr; Manage<\/strong>.<\/li>\n\n\n\n<li>On the Overview screen, locate the <strong>Disk usage<\/strong> panel to see an overview of free and total disk usage.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"6a9b7907794fa\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a9b7907794fa\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"596\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2025\/12\/PHP-alt-1.jpg\/w=1024,h=1024,fit=scale-down\" alt=\"Hostinger's VPS Overview section with disk usage highlighted\" class=\"wp-image-125751\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2025\/12\/PHP-alt-1.jpg\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2025\/12\/PHP-alt-1.jpg\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2025\/12\/PHP-alt-1.jpg\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2025\/12\/PHP-alt-1.jpg\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" data-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.thisImage.buttonRight\" data-wp-style--top=\"state.thisImage.buttonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>Click the <strong>Disk Usage<\/strong> section to monitor disk space usage over specific periods, such as daily, weekly, monthly, and annually.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/06\/hpanel-vps-server-usage.png\"><img decoding=\"async\" width=\"2210\" height=\"1024\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hpanel-vps-server-usage.png\/w=1024,h=1024,fit=scale-down\" alt=\"The Disk Space statistic on the Server Usage page\" class=\"wp-image-111057\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hpanel-vps-server-usage.png\/w=2210,fit=scale-down 2210w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hpanel-vps-server-usage.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hpanel-vps-server-usage.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hpanel-vps-server-usage.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hpanel-vps-server-usage.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hpanel-vps-server-usage.png\/w=1536,fit=scale-down 1536w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hpanel-vps-server-usage.png\/w=2048,fit=scale-down 2048w\" sizes=\"(max-width: 2210px) 100vw, 2210px\" \/><\/a><\/figure><\/div><p class=\"wp-block-paragraph\">You can also ask Hostinger Agent questions like &ldquo;Check the current disk usage of my VPS&rdquo; or &ldquo;Check the block devices on my VPS.&rdquo; Should you need to clean up temporary files or data from your disk, you can also ask it, &ldquo;Clean up system logs and temporary files from my server.&rdquo;<\/p><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"6a9b79077c0e6\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a9b79077c0e6\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/11\/hostinger-agent-check-disk-usage.png\/w=1024,h=1024,fit=scale-down\" alt=\"Hostinger Agent checking the current disk usage of a VPS\" class=\"wp-image-154042\"><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" data-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.thisImage.buttonRight\" data-wp-style--top=\"state.thisImage.buttonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p class=\"wp-block-paragraph\">If you prefer to run Linux commands to check your server&rsquo;s disk space, you can use our built-in <strong>Browser terminal<\/strong>. Here, you can execute commands similar to those used in Terminal or SSH applications.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/06\/hpanel-vps-overview-browser-terminal-highlighted.png\"><img decoding=\"async\" width=\"2100\" height=\"186\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hpanel-vps-overview-browser-terminal-highlighted.png\/w=1024,h=1024,fit=scale-down\" alt=\"The Browser terminal feature in the VPS dashboard\" class=\"wp-image-111058\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hpanel-vps-overview-browser-terminal-highlighted.png\/w=2100,fit=scale-down 2100w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hpanel-vps-overview-browser-terminal-highlighted.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hpanel-vps-overview-browser-terminal-highlighted.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hpanel-vps-overview-browser-terminal-highlighted.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hpanel-vps-overview-browser-terminal-highlighted.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hpanel-vps-overview-browser-terminal-highlighted.png\/w=1536,fit=scale-down 1536w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hpanel-vps-overview-browser-terminal-highlighted.png\/w=2048,fit=scale-down 2048w\" sizes=\"(max-width: 2100px) 100vw, 2100px\" \/><\/a><\/figure><\/div><p class=\"wp-block-paragraph\">To access it, click <strong>Browser terminal<\/strong> in your VPS dashboard. Then, log in using your SSH credentials and start executing the commands.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/06\/hostinger-browser-terminal.png\"><img decoding=\"async\" width=\"1602\" height=\"708\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hostinger-browser-terminal.png\/w=1024,h=1024,fit=scale-down\" alt=\"Running a command in Hostinger's Browser terminal\" class=\"wp-image-111059\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hostinger-browser-terminal.png\/w=1602,fit=scale-down 1602w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hostinger-browser-terminal.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hostinger-browser-terminal.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hostinger-browser-terminal.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hostinger-browser-terminal.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/44\/2024\/06\/hostinger-browser-terminal.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 1602px) 100vw, 1602px\" \/><\/a><\/figure><\/div><p class=\"wp-block-paragraph\"><a href=\"\/ph\/tutorials\/how-to-monitor-vps-performance\/\">Monitor your VPS performance<\/a> regularly to spot unexpected storage growth before the filesystem becomes full.<\/p><figure class=\"wp-block-image size-large\"><a href=\"\/ph\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/02\/VPS-hosting-banner.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/02\/VPS-hosting-banner-300x88.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/02\/VPS-hosting-banner-150x44.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/02\/VPS-hosting-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-how-to-find-what-is-using-the-most-disk-space\">How to find what is using the most disk space<\/h2><p class=\"wp-block-paragraph\">To find what is using the most disk space in Linux, sort directories by size and then inspect the largest ones.<\/p><p class=\"wp-block-paragraph\">For example, to compare the top-level directories in the root filesystem, run:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo du -xh --max-depth=1 \/ | sort -hr<\/pre><p class=\"wp-block-paragraph\">The <code>-x<\/code> option keeps the scan on the same filesystem, while <code>sort -hr<\/code> orders the results from largest to smallest.<\/p><p class=\"wp-block-paragraph\">The output may look like this:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">18G     \/\n9.4G    \/var\n5.2G    \/usr\n2.6G    \/home\n340M    \/opt<\/pre><p class=\"wp-block-paragraph\">If <code>\/var<\/code> is using the most space, scan it in the same way:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo du -xh --max-depth=1 \/var | sort -hr<\/pre><p class=\"wp-block-paragraph\">Continue checking the largest directories until you identify where most of the storage is being used.<\/p><p class=\"wp-block-paragraph\">To find individual files larger than 1 GB on the current filesystem, use the <code><a href=\"\/ph\/tutorials\/find-command\/\">find<\/a><\/code><a href=\"\/ph\/tutorials\/how-to-use-find-and-locate-commands-in-linux\/\"> command<\/a> with a size filter:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo find \/ -xdev -type f -size +1G -exec du -h {} + | sort -hr<\/pre><p class=\"wp-block-paragraph\">This lists files larger than 1 GB and sorts them from largest to smallest.<\/p><p class=\"wp-block-paragraph\">Before deleting large files, confirm that they are not required by the operating system, an application, or an active service.<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-troubleshoot-a-full-linux-disk\">How to troubleshoot a full Linux disk<\/h2><p class=\"wp-block-paragraph\">To troubleshoot a full Linux disk, first check which filesystem is full with <code>df -h<\/code>, then investigate its directories, files, and inode usage.<\/p><p class=\"wp-block-paragraph\">If a filesystem is close to 100% usage, use the <code>du<\/code> and <code>find<\/code> commands from the previous sections to locate the largest directories and files.<\/p><p class=\"wp-block-paragraph\">If Linux reports <strong>No space left on device<\/strong> even though <code>df -h<\/code> shows available storage, check inode usage:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">df -ih<\/pre><p class=\"wp-block-paragraph\">The <strong>IUse%<\/strong> column shows the percentage of available inodes being used. A filesystem can run out of inodes when it contains a very large number of small files, even if storage capacity remains available.<\/p><p class=\"wp-block-paragraph\">You may also notice that <code>df<\/code> reports more used space than <code>du<\/code>. One possible cause is a deleted file that is still open by a running process. To check for open deleted files, run:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo lsof +L1<\/pre><p class=\"wp-block-paragraph\">If the command returns a large deleted file, identify the process using it before restarting or stopping the related service. Avoid terminating processes or deleting system files unless you understand their role.<\/p><p class=\"wp-block-paragraph\">In most cases, checking <code>df -h<\/code>, identifying large directories with <code>du<\/code>, and checking inode usage with <code>df -ih<\/code> will reveal why a Linux filesystem is running out of space.<\/p><h2 id=\"h-conclusion\" class=\"wp-block-heading\">What to do when your Linux disk is running out of space<\/h2><p class=\"wp-block-paragraph\">If your Linux disk is running low on space, use <code>df -h<\/code> to identify the affected filesystem, then use <code>du<\/code>, <code>find<\/code>, or <code>ncdu<\/code> to locate the directories and files consuming the most storage.<\/p><p class=\"wp-block-paragraph\">Once you identify the cause, remove only files you no longer need, such as outdated backups, temporary files, or unnecessary logs. If the filesystem still has free storage but Linux reports <strong>No space left on device<\/strong>, check inode usage with <code>df -ih<\/code>.<\/p><p class=\"wp-block-paragraph\">For ongoing server maintenance, monitor disk usage regularly so you can address unexpected storage growth before it affects applications or services.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To check disk space in Linux, run the df -h command. It shows the total, used, and available space for each mounted filesystem in an easy-to-read format. If you need to find what is taking up that space, use the du command to check the size of specific directories and files. In this tutorial, you&rsquo;ll [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ph\/tutorials\/how-to-check-disk-space-in-linux\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to check disk space in Linux using df and du","rank_math_description":"Learn how to check disk space in Linux using df and du, find large files and directories, check inode usage, and troubleshoot a full filesystem.","rank_math_focus_keyword":"check disk space linux","footnotes":""},"categories":[22663],"tags":[],"class_list":["post-698","post","type-post","status-publish","format-standard","hentry","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-check-disk-space-in-linux\/","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/como-verificar-o-uso-de-espaco-em-disco-no-linux\/","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/espace-disque-linux\/","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/revisar-espacio-en-el-disco-linux\/","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-check-disk-space-usage-di-linux\/","default":0},{"locale":"ja-JP","link":"https:\/\/www.hostinger.com\/jp\/tutorials\/how-to-check-disk-space-in-linux\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-check-disk-space-in-linux\/","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-check-disk-space-in-linux\/","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-check-disk-space-in-linux\/","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-check-disk-space-in-linux\/","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-check-disk-space-in-linux\/","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-check-disk-space-in-linux\/","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-check-disk-space-in-linux\/","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/revisar-espacio-en-el-disco-linux\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/revisar-espacio-en-el-disco-linux\/","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/revisar-espacio-en-el-disco-linux\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/como-verificar-o-uso-de-espaco-em-disco-no-linux\/","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/comments?post=698"}],"version-history":[{"count":34,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/698\/revisions"}],"predecessor-version":[{"id":133726,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/698\/revisions\/133726"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/media?parent=698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/categories?post=698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/tags?post=698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}