S
S
Sergey Karbivnichy2021-11-12 20:16:23
linux
Sergey Karbivnichy, 2021-11-12 20:16:23

How to find out the size of a directory, excluding some directories?

This is how I get the size of the directory in GB: du -sh ~
But how to exclude, for example, ~/.cache, ~/.config/google-chrome...
I looked at man, there are such arguments:

-X, --exclude-from=ФАЙЛ  исключить файлы, совпадающие с любым шаблоном
                           из ФАЙЛа
      --exclude=ШАБЛОН     исключить файлы, совпадающие с ШАБЛОНом

Something I can't figure out.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ronald McDonald, 2021-11-12
@hottabxp

du -sh ~ --exclude=~/.cache --exclude=~/.config/google-chrome

A
Alexander Karabanov, 2021-11-13
@karabanov

ncdu --exclude=.cache --exclude=.config/google-chrome

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question