---
title: 'Checking Disk Usage in Linux OS | Zomro'
description: 'The article discusses utilities for checking the disk usage of files and folders in a Linux system without a graphical interface.'
image: 'https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a44%40server-panel.net/2023/08/06/image-20230806154643-1.jpg'
---

![opened image]()

  * [Zomro](https://zomro.com/)
  * [FAQ](https://zomro.com/blog/faq/)
  * Checking Disk Usage in Linux OS 



# Checking Disk Usage in Linux OS

06-08-2023

There are several ways to check disk usage on a Linux operating system without a GUI installed.

  
For example, if a web site control panel is installed on the server, you can use its tools. You can find more details about them in the documentation of a specific web panel.

  
But it is most convenient to use the console for this by connecting to the server via SSH. Linux systems have several handy applications that can be used for this.

  
This article will cover the _du_ and _ncdu_ utilities. The _du_ utility is already installed on your system as it is part of the core Linux file and text utilities (coreutils). The _ncdu_ utility can be installed using your system's package manager.  

    
    
    # For deb-like
    
    apt install ncdu
    
    # For RedHat derivatives (e.g. CentOS)
    
    yum install ncdu

  
First, let's check the total amount of used or free disk space. To do this, we will use another built-in _df_ command:
    
    
    df-h

  
Here, the **-h** switch specifies that the size values should be displayed in a human-readable form (in kilobytes, megabytes, gigabytes).

  
First of all, we are interested in the string of the device mounted as the root partition.

![Checking Disk Usage in Linux OS - 1](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a44%40server-panel.net/2023/08/06/image-20230806154643-1.jpg)

To check the disk usage of files in the current folder, navigate to the folder and run the command:
    
    
    du -s -h .

  
Here the **-s** switch means summarize (counting the total amount of space occupied by the files and folders specified in the arguments).

**-h** \- display size values in a human-readable form (in kilobytes, megabytes, gigabytes).

**.** (dot) - on a Linux system, indicates the current directory.

  
You can navigate to the desired folder using the _cd /path/to/folder_ command. For example,

  

    
    
    cd /var/log

  
Keys can be combined together, as shown below. This is a more convenient way to use this command.
    
    
    du -sh .

  
You can also specify the full path to the folder, for example:
    
    
    du -sh /var/log

![Checking Disk Usage in Linux OS - 2](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a44%40server-panel.net/2023/08/14/image-20230814111702-1.jpg)

As arguments, you can specify several paths to the folders you want to check. In the same way, you can check the sizes of all subfolders of the current folder.
    
    
    du -shc *

![Checking Disk Usage in Linux OS - 3](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a44%40server-panel.net/2023/08/17/image-20230817144502-1.jpg)

Here we indicate ***** (asterix), which means all files and folders in the current directory.

Using the **-c** switch, you can calculate the total size occupied by all files specified in the arguments. Adds the _total_ value to the bottom of the list.

  
All of the above information is provided in a more convenient form by the _ncdu_ command. Installation of this utility is described at the beginning of the article. Navigate to the desired folder and run the following command:
    
    
    ncdu

  
When the program is launched, the utility calculates the occupied space starting from the folder in which it was launched. This is the start folder. If you need to check the used space for the entire file system, you can go to the root directory (_cd /_) and run the utility. The counting process can take a long time. In this example, the _/usr/share_ folder is used, as indicated at the top of the application.

![Checking Disk Usage in Linux OS - 4](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a44%40server-panel.net/2023/08/27/image-20230827121518-2.jpg)

At startup, you will see the file manager in which the current folder is open. All subfolders and files are here, sorted by actual size.Also pseudo-graphics displays bars showing the relative size of files and folders. The largest file or folder has a completely filled bar.

  
With this program, you can check how much space is occupied by the current folder, each subfolder and file in the current folder, you can navigate through subfolders, delete files. You can move through the list items using the cursor keys and the enter key. You can delete files or a folder using the **d** key. This will generate a warning that can be turned off. Be careful. Deleting files is irreversible on Linux systems.

  
To exit the application, use the **q** button.

###   
Conclusion

Utilities for checking disk usage by files and folders in a Linux system without a graphical interface were considered.

Similar articles:

[How to create and delete an additional domain in cPanel?](https://zomro.com/blog/faq/190-kak-sozdat-i-udalit-dopolnitelnyj-domen-v-cpanel) [How to install Nginx in Docker-Compose](https://zomro.com/blog/faq/317-kak-ustanovit-nginx-v-docker-compose) [Adding a database to the VestaCP panel](https://zomro.com/blog/faq/387-adding-a-database-to-the-vestacp-panel) [How to see whois of a domain](https://zomro.com/blog/faq/395-how-to-see-whois-of-a-domain) [Connecting to a Windows Server via RDP (Remote Desktop)](https://zomro.com/blog/faq/685-connecting-to-a-windows-server-via-rdp-remote-desktop)

[ Forex Server from €7.95/mon ](/server-for-forex)
