How to Check Disk Space Usage in Linux
As a system administrator, learning Linux commands helps improve your server management efficiency. For instance, you can use them to easily check your virtual private server’s disk space usage.
In this article, we will explain how to check disk space in Linux using the dr and du commands. The df command is used to check storage space, while du is for monitoring disk usage.
We will also explain how to combine these commands to manage your VPS files more effectively. Moreover, you will learn how to check disk space and optimize storage with Hostinger using our built-in features.

Analyzing the Hard Drive
Since the df and du commands have slightly different purposes, we will explain them in separate sections. Before proceeding, connect to your remote server using Terminal or an SSH client like PuTTY.
Check Disk Space in Linux Using the df Command
The df command, or Disk Filesystem, is used to check disk space. It displays the amount of used and available storage space in your machine.
When executing this command, you will see the default columns: Filesystem, Size, Used, Available, Use%, and Mounted On. It should look something like this:

- Filesystem – provides the file system name.
- Size – provides the total size of the specified file system.
- Used – shows disk space usage in the particular file system.
- Available – specifies the remaining disk space in the file system.
- Use% – displays the amount of used disk space in percentage.
- Mounted On – tells us a particular file system’s mount point.
Add an option to the df command for detailed disk space checking in Linux. Popular options include:
- df -h – shows the result in a human-readable format.
- df -m – displays file system usage information in MB.
- df -k – tells users the file system usage in KB.
- df -T – specifies the file system type in a new column.
- df /home – allows you to view information about a specific file system in a readable format. In this example, it’s the /home file system.
- df – help – lists other options to use and their descriptions.
Check Disk Usage in Linux Using the du Command
The du or Disk Usage command will show files and directories’ disk usage on your Linux system. This SSH command requires you to specify which folder or file to check. Here’s the syntax:
Consider these du command usage examples with the /Desktop directory:
- du /home/user/Desktop – allows users to see the disk usage of their Desktop folders and files, including subdirectories.
- du -h /home/user/Desktop – displays information in a human-readable format, similar to the -h option for the df command.
- du -sh /home/user/Desktop – gives us the total size of a specified folder, namely Desktop.
- du -m /home/user/Desktop – provides us with folder and file sizes in MB. Replace -m with -k to see the information in KB.
- du -h – time /home/user/Desktop – retrieves the last modification date of the displayed folders and files.
- df –help – displays a list of available options with their usage.
Combining Commands and Cleaning Disk Space
You can combine the df and du commands with other arguments for more detailed information. It gives you more insights into which files you can delete to free up disk space.
Start with the df command to determine which file system needs an immediate cleanup. Then, run these combinations.
Important! We will use the /home/user/Desktop directory path for this tutorial. To check another directory, change it accordingly.
Sorting Files By Size
To sort files by size, run the du command to list files and folders on /Desktop in a readable format. Then, pipe the result to the sort command with the -rn option.
The script will sort all the files and folders by size in descending order to check the disk space usage in your Linux system. The combination should look like this:
Remember that you shouldn’t delete files solely based on their size. If not careful, you might delete essential files that will break your project or virtual private server.
Excluding by File Size
If you want to see all files beyond a certain size, the most effective way is to use the command below:
The grep command lets us search files based on a specified pattern. In this example, the script will output all files bigger than 1 GB. If you want to list files over 1 MB, replace G with M.
Excluding File Types
If you want to exclude a particular file format from the search results, use the following combination:
The –exclude=”.txt” argument tells the du command to display all file formats except .txt documents.
Efficiently Optimizing Disk Space in Hostinger VPS
Hostinger VPS hosting plans offer various features that help users efficiently manage their server’s disk space. For example, our custom hosting control panel hPanel has a built-in analytics tool showing your VPS storage space usage.
This feature is useful for a quick analysis since you can access it directly from your browser. It also offers a graphical user interface (GUI) that simplifies the task for non-technical users.

To access it, open hPanel and click VPS on the top menu. Select the VPS in question and navigate to Server Usage on the sidebar. You can also select different periods to check disk usage over time.
If you prefer to use commands to check and optimize your remote server’s disk space, use our built-in Browser terminal. This feature allows you to execute bash commands without Terminal or an SSH client.

To access it, click Browser terminal on your VPS overview menu. Then, log in using the root account and start executing the commands.
Pro Tip
Use our GPT-powered AI Assistant to quickly generate commands based on simple prompts.
Moreover, hPanel has a Disk Quota feature for setting VPS storage space usage limits to avoid performance issues. Follow these steps to activate it:
- On hPanel, click the VPS menu.
- Select the VPS in question → Settings on the sidebar.
- Click the Disk Quota toggle. Wait until the change is applied.
- Navigate to Settings on the sidebar → Panel Access
- Click the Panel access URL and log in to your account.
- Set the Disk Quota limit. The steps and setting location differ depending on the control panel.
Conclusion
The df and du commands are important file management utilities in a Linux system. The df command is used to check the disk usage of a file system, while du is for analyzing files or directories storage consumption.
These commands take various options to refine the output based on your needs, like -h, -m, and -k. You can also combine them with other commands, such as sort, grep, and exclude for a more specific output.
While running these commands requires Terminal or an SSH, Hostinger VPS plans’ Browser terminal lets you run them directly via a web browser. Moreover, you can use hPanel to quickly see the disk usage and set a quota to optimize it.
Discover Other Linux Commands for Server Management
Domantas leads the content and SEO teams forward with fresh ideas and out of the box approaches. Armed with extensive SEO and marketing knowledge, he aims to spread the word of Hostinger to every corner of the world. During his free time, Domantas likes to hone his web development skills and travel to exotic places.
How to Check Free Disk Space on Linux [Terminal and GUI Methods]
![]()
The simplest way to find the free disk space on Linux is to use df command. The df command stands for disk-free and quite obviously, it shows you the free and available disk space on Linux systems.
With -h option, it shows the disk space in human-readable format (MB and GB).
Here’s the output of the df command for my Dell XPS system that has only Linux installed with encrypted disk:
If the above output is confusing for you, don’t worry. I’ll explain a few things around checking available disk space in Linux. I’ll also show the GUI method for desktop Linux users.
Method 1: Checking free disk space in Linux with df command (and understanding its output)
When you use the df command to check disk space, it will show a bunch of ‘file systems’ with their size, used space and free space. Your actual disks should normally be listed as one of the following:
- /dev/sda
- /dev/sdb
- /dev/nvme0n1p
This is not a hard and fast rule but it gives you an indication to easily recognize the actual disk from the crowd.
Your Linux system might have several partitions on your disk for boot, EFI, root, swap, home etc. In such cases, these partitions are reflected with a number at the end of the ‘disk name’, like /dev/sda1, /dev/nvme0n1p2 etc.
You could identify which partition is used for what purpose from its mount point. Root is mounted on /, EFI in /boot/EFI etc.
In my case, I have used 41% of the 232 GB of disk space under root. If you have 2–3 big partitions (like root, home etc), you’ll have to make a calculation here.
- tmpfs: The tmpfs (temporary filesystem) used for keeping files in virtual memory. You can ignore this virtual filesystem comfortably.
- udev: The udev filesystem is used for storing information related to devices (like USB, network card, CD ROM etc) plugged to your system. You may ignore it as well.
- /dev/loop: These are loop devices. You’ll see plenty of them while checking disk space in Ubuntu because of snap applications. Loops are virtual devices that allow normal files to be accessed as block devices. With the loop devices, snap applications are sandboxed in their own virtual disk. Since they are under root, you don’t need to count their used disk space separately.
Missing disk space? Check if you have mounted all disks and partitions
Keep in mind that the df command only shows disk space for mounted filesystems. If you are using more than one Linux distribution (or operating systems) on the same disk or you have multiple disks on your system, you need to mount them first in order to see the free space available on those partitions and disks.
For example, my Intel NUC has two SSDs and 4 or 5 Linux distributions installed on them. It shows additional disks only when I mount them explicitly.
How to find out how much disk space is remaining?
What is the command to find out how much disk space is being used/remaining?
9 Answers 9
You can use two commands: df and du .
df — report file system disk space usage
Usage works like such:
Which should output something like this:
The -h flag provides human readable output (which makes reading of the output — easier).
du — estimate file space usage
A second tool is with du which is a slower approach but will give you a better break down of a per directory. Information on that can be found in How to determine where the biggest files/directories on my system are stored?
There are several good command line tools for reporting disk usage. Use the one that’s most helpful to you:
df is installed by default.
Column headers are colored.
discus
Column headers and progress bars are colored.
You can use this command to find out how much space files in your home directory (replace
/ with / for entire filesystem) and sort by largest files
![]()
GNOME System Monitor
If you prefer graphical gnome-system-monitor :

Disk Usage Analyzer

The Disk Usage Analyzer counterpart for CLI would be ncdu .
For example, du -sh /home/mark will show a summarised usage report in human-readable output for /home/mark .
You can also use ncdu (available directly from the Ubuntu repos) which use the ncurses library for showing a graphical overview directly in the terminal.
will analyze disk usage on root partition without crossing filesystem boundaries.
df -h is your best bet (run it in the Terminal).
Note that df -h will show you only remaining space on mounted partitions. Suppose there are NTFS and FAT32 partitions too before running it note that mount all the partitions. If Ubuntu is sole OS on your machine then I don’t see any problem with df .
Get one value that expresses disk utilization in percent
This expression takes all volumes total, available und used space in kB and summarizes the values and finally calculates a total percentage of disk utilization.
Use this at your own risk.
This might possibly fail for your use case. If you want to manually check disk utilization df -h will be totally fine.
Again, this is by no means perfect. If you use this, make sure you test this individually on each machine if the volumes you are interested in are covered and represented with the correct return values.
Full command for custom monitoring expressions (e.g. zabbix)
I wanted to exclude volumes whose usage is smaller than 5GB (5000000 kB) and also exclude some other volumes I had no interest in. This works nicely with zabbix or any other monitoring tool that uses custom expressions.
You can debug this by removing the awk expression and decide what you want to include or not.
This command parameterizes a threshold value with a Makro in Zabbix and looks like this:
Узнаем свободное место на диске в Linux

После продолжительной работы за компьютером на диске скапливается много файлов, тем самым занимая свободное место. Порою его становится настолько мало, что компьютер начинает терять производительность, а установка нового программного обеспечения не может быть выполнена. Чтобы такого не произошло, необходимо контролировать размер свободного пространства на винчестере. В Linux это можно сделать двумя способами, которые и будут рассмотрены в этой статье.
Проверка свободного места на диске в Linux
В операционных системах на базе ядра Linux существует два кардинально отличающихся способа, которые предоставляют инструменты для анализа дискового пространства. Первый подразумевает использование программ с графическим интерфейсом, что в значительной мере облегчает весь процесс, а второй — выполнение специальных команд в «Терминале», что неопытному пользователю может показаться довольно сложной задачей.
Способ 1: Программы с графическим интерфейсом
Пользователю, который еще в достаточной мере не ознакомился с системой на базе Linux и неуверенно себя чувствует, работая в «Терминале», будет удобнее всего проверять свободное место на диске, используя для этих целей специальные программы, имеющие графический интерфейс.
GParted
Стандартизированной программой для проверки и мониторинга свободного места на жестком диске в операционных системах на базе ядра Linux является GParted. С ее помощью вы получаете следующие возможности:
- отслеживать количество свободного и занятого места на винчестере;
- распоряжаться объемом отдельных разделов;
- увеличивать или уменьшать разделы по своему усмотрению.
В большинстве пакетов она установлена по умолчанию, но если таковой все же не оказалось, ее можно установить при помощи менеджера приложений, вписав в поиске название программы или же через «Терминал», выполнив поочередно две команды:
sudo update
sudo apt-get install gparted
Запускается приложение из главного меню Dash посредством вызова его через поиск. Также запуск можно осуществить, введя данное условие в «Терминал»:
Слово «pkexec» в данной команде означает, что все действия, выполняемые программой, будут происходить от имени администратора, а значит вам придется ввести свой личный пароль.
Примечание: при вводе пароля в «Терминале» он никак не отображается, поэтому стоит вслепую ввести необходимые символы и нажать клавишу Enter.
Главный интерфейс программы достаточно прост, интуитивно понятен и выглядит следующим образом:

Верхняя его часть (1) отведена под управление процессом распределения свободного места, ниже – наглядный график (2), показывающий, на сколько разделов поделен винчестер и сколько в каждом из них занято места. Вся нижняя и большая часть интерфейса отведена под подробный график (3), описывающий состояние разделов с большей точностью.
Системный монитор
В том случае, если вы используете ОС Ubuntu и среду пользователя Gnome, то проверить состояние памяти на вашем жестком диске можно через программу «Системный монитор», запускаемую через интерфейс Dash:

В самом приложении нужно открыть крайнюю правую вкладку «Файловые системы», где и будет отображаться вся информация о вашем винчестере:

Стоит предупредить, что в среде рабочего стола KDE такая программа не предусмотрена, но некоторую часть информации можно получить в разделе «Информация о системе».
Строка состояния в Dolphin
Пользователям KDE предоставляется еще одна возможность проверить, сколько же незадействованных гигабайт на данный момент находится в их распоряжении. Для этого нужно воспользоваться менеджером файлов Dolphin. Однако изначально необходимо внести некоторые коррективы в системные параметры, чтобы в файловом менеджере появился необходимый элемент интерфейса.
Для того чтобы включить эту функцию, нужно перейти во вкладку «Настроить», выбрать там графу «Dolphin», затем «Главное». После нужно попасть в раздел «Строка состояния», где потребуется выставить маркер в пункте «Показывать сведения о свободном месте». После этого нажимаете «Применить» и кнопку «ОК»:

После всех манипуляций все должно выглядеть следующим образом:

До недавнего времени такая функция была и в файловом менеджере Nautilus, который используется в Ubuntu, но с выходом обновлений она стала недоступна.
Baobab
Четвертый способ осведомиться о свободном пространстве на вашем винчестере – приложение Baobab. Данная программа является стандартным анализатором использования жестких дисков в операционной системе Ubuntu. Baobab в своем арсенале имеет не только список всех папок на винчестере с подробным описанием, вплоть до даты последнего изменения, но и круговую диаграмму, которая довольно удобная и позволяет визуально оценить объем каждой из папок:

Если по какой-то причине программа в Ubuntu у вас отсутствует, то вы можете ее загрузить и установить, выполнив поочередно две команды в «Терминале»:
sudo update
sudo apt-get install baobab
Кстати, в операционных системах со средой рабочего стола KDE есть своя аналогичная программа — FileSlight.
Способ 2: Терминал
Все вышеперечисленные программы объединяло, помимо прочего, наличие графического интерфейса, но в Linux предусмотрен способ проверить состояние памяти и через консоль. Для этих целей используют специальную команду, основное предназначение которой заключается в анализе и выводе на экран информации о свободном пространстве на диске.
Команда df
Для получения информации о диске компьютера введите следующую команду:

Для того чтобы упростить процесс чтения информации, воспользуйтесь этой функцией:

Если же вы хотите проверить состояние памяти в отдельном каталоге, укажите путь к нему:

Или же можно указать имя устройства, если есть необходимость:

Опции команды df
Помимо опции -h, утилита поддерживает и прочие функции, такие как:
| -m | Вывести информацию о всей памяти в мегабайтах |
| -T | Показать вид системы файлов |
| -a | Показать в списке все файловые системы |
| -i | Отобразить все иноды |
На самом деле, это не все опции, а лишь наиболее популярные. Чтобы просмотреть полный их список, необходимо выполнить в «Терминале» следующую команду:
По итогу перед вами будет такой список опций:

Заключение
Как можно заметить, способов, с помощью которых можно проверить свободное место на диске, много. Если вам необходимо получить лишь базовые сведения о занятом пространстве диска, то проще всего использовать одну из приведенных программ с графическим интерфейсом. В том случае, если вы хотите получить более детальный отчет, подойдет команда df в «Терминале». К слову, программа Baobab способна предоставить не менее подробную статистику.