Ahmadhc
Ahmadhc

Reputation: 173

Get the size of a repo in linux excluding specific sub-repo

I am want to know the size of a repository in linux, excluding recusively all the subfolder that start with horizons:

I tried this command but i couldn't get the needed result:

find -type d -not -name "horizons*" -exec du -sh {} \;

Upvotes: 1

Views: 41

Answers (1)

pacholik
pacholik

Reputation: 8982

du has an option --exclude=PATTERN

du -sh repo --exclude 'horizons*'

Upvotes: 3

Related Questions