Linux folder used space - Bash TreeSize

To find out which folder needs how much space, the command “du” can be used on Debian. For an even better overview there is the commandline tool ncdu, which can analyze all folders similar to TreeSize.


du -ah -d1 /var/www/vhosts

The parameter -d1 shows only first level folders


a... used space for all files and

h...Human Readable, i.e. in a readable format: K, M, ... for kilobytes, megabytes, ...

Memory hog


If the Linux Journal becomes very large, it can be limited as follows:

Only the most recent entries are then kept:

root@server:/var/log/journal# du -ah -d1 
3.8G    ./dbd2984f94c34d65b0839d60d6f48b1b
8.1M    ./53955387d3174396b874db791b202516
3.8G    .

In the following file the journal can be limited:

 vi /etc/systemd/journald.conf

As an example on 500M



PRUNEPATHS customize:

sudo vi /etc/updatedb.conf

sudo updatedb

ncdu - NCurses Disk Usage

With ncdu an overview of the used space for all folders can be displayed very quickly:

sudo apt install ncdu

After Installation for example the Root-Partition can be scanned using the following command:

sudo ncdu / -x

The Parameter -x excludes other mounted Disks (Do not cross filesystem boundaries, i.e. only count files and directories on the same filesystem as the directory being scanned.)

positive Bewertung({{pro_count}})
Rate Post:
{{percentage}} % positive
negative Bewertung({{con_count}})

THANK YOU for your review!

Updated: 2023-06-06 von Bernhard | Übersetzung Deutsch |🔔 | Comments:0

Debian or Ubuntu kernel update or change- current kernel | Linux | ZFS vs BTRFS - file system | deduplication and snapshots

Top articles in this section

Fan control Linux Debian: Fancontrol

After I installed a fan in my NAS, it always ran at top speed. In the BIOS I could set the speed, but the automatic mode did not work properly. Using the service fancontrol the speed of the fan can be linked to any sensor and any threshold and controlled automatically.

Debian or Ubuntu kernel update or change- current kernel

The currently available Linux kernel has the version: 6.6.4 (found: 2023-12-04). Source: The Linux distributions, as an example Debian or Ubuntu used new kernel versions only with some delay, accordingly the used kernel versions are usually somewhat older. Which kernel is active on a Linux system can be read out with the following command:

ZFS vs BTRFS - file system | deduplication and snapshots

In my search for file system features like snapshots or deduplication, I ended up with the file systems ZFS and later BTRFS. In the Linux environment, the ext4 file system is currently a quasi-standard, but file systems like ZFS and BTRFS offer considerable added value.

Questions / Comments

By continuing to browse the site, you agree to our use of cookies. More Details