This is probably something basic but I'm not able to make it work. I'm trying to use DU to get a total size of files minus certain directories. I need to exclude one specific directory called
uploads but not every directory called
uploads. For example, my file structure looks a bit like this:
I can run the following command:
du -ch --exclude=uploads*
and it gives me the file size minus all the "uploads" directories. However, in trying to exclude certain directories (and all its sub-directories) I fail. I've tried variations of:
du -ch --exclude=./uploads*
du -ch --exclude='/full/path/to/uploads/*'
but can't seem to figure it out. How do I exclude a specific directory?