Skip to content
www.mytechnote.ru
Menu
  • Administration
    • Scripts
  • Equipment
    • Reviews
    • Instructions
  • Other
  • English
    • English
    • Русский
Menu

Ubuntu – find out the free space

How much free space is left? Who took it? These two issues have to be faced constantly, especially file server administrators. If on the Windows platform, in a graphical environment, it’s not difficult to find out, then the console of server versions of Linux can confuse many. However, do not be afraid, it’s quite easy to get interesting information in the Linux environment.

As practice showed, this issue is relevant not only for novice administrators. Indeed, it is not enough just to find out the size of a file or folder, but you need to quickly and efficiently find out exactly who has taken up disk space and what. But first things first.

Let’s start with a simple question, how to see how much free space is left.

For this purpose, there is a command df -h which displays a list of all file systems, their size and mount points. The -h switch allows you to display information in a convenient form for viewing – in megabytes and gigabytes, without a key, information about the size is displayed in blocks.

We answered the first question, but, as a rule, this answer raises even more questions. From the information received is absolutely not clear what exactly is the disk full. This can be both important data, and photos from the latest corporative event, “carefully” duplicated by users on their network folders. In the first case, you should think about increasing the volume of the disk subsystem, and in the second you can safely clean the disk and conduct explanatory conversations.

To answer the second question, we need to know the size of individual folders and files.

On Linux systems, this can be done with the du command, indicating the folder of interest, or you can specify the -h option to get user-friendly results.

Despite the fact that this team works, there is no practical benefit from it. Why? Now we will explain, the part of the command output is shown below: du -h / usr

5,5M    /usr/local/java/jdk1.8.0_65/db/lib
104K    /usr/local/java/jdk1.8.0_65/db/bin
5,7M    /usr/local/java/jdk1.8.0_65/db
353M    /usr/local/java/jdk1.8.0_65
526M    /usr/local/java
4,0K    /usr/local/games
526M    /usr/local
6,5G    /usr

Yes, we found out that the / usr folder has a size of 6.5 GB, but we did not get the idea of what exactly takes the main place in this folder. There was not a whole picture about how to fill the disk space, and there is not.

But do not despair, a small ncdu utility comes to our aid, it does not exist in the standard installation, but it is installed without any problems from the repository: apt-get install ncdu

The unattended utility displays information about the current folder, but since we are interested in the entire file system , Then specify the root directory as a parameter: After a short calculation, the utility displays a hierarchical list of directories starting with the largest size: Well, that’s quite another matter. Immediately see what exactly is occupied by disk space. The utility is interactive, we can navigate through the tree, enter folders, change the presentation of information, delete unnecessary files and directories. All the features of the program can be found by calling the built-in help: As you can see, the utility is simple, but very rich in features, for example, you can quickly include a more visual representation of the data: Now the question of what disk space is used and what to do it is solved in just a few minutes. In our opinion, this utility should be in the arsenal of every system administrator.

Taken from: http://interface31.ru/tech_it/2012/09/ubuntu-server-kak-uznat-svobodnoe-mesto-na-diske.html

Posted on 29.06.201730.05.2024 by sanglyb

Post navigation

← Bottleneck searching on Windows
How to enable test mode on windows 2012 →

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Подписывайтесь

Youtube
vk
telegram
github
twitter
rss
  • Форум
  • Об авторе
  • Поддержать автора

Популярные записи

Новые записи

  • How to Extend an LVM Partition in Linux
  • SCCM Reporting Errors After Migrating from SQL Server 2016 to 2019
  • Problem Using PassFiltEx on Older CPUs
  • How to remove attachments from old calendar events in Exchange using a script
  • How to download and install Office 2024 LTSC

Архивы

  • 2026 (3)
  • 2025 (5)
  • 2024 (7)
  • 2023 (30)
  • 2022 (4)
  • 2020 (17)
  • 2017 (82)
  • 2016 (5)
© 2015-2026 www.mytechnote.ru
Использование материалов сайта возможно только с разрешения владельца или обязательна индексируемая, прямая, передающая вес ссылка на материал.