From what I understand it's not possible to exclude a directory path
with the du command, this would be very nice to have.
mkdir -p 1/1 2/2 3/3
echo "count me" > 1/1/file1
echo "count me" > 2/2/file2
echo "exclude me" > 3/3/file3
du
4 ./1/1
4 ./1
4 ./2/2
4 ./2
4 ./3/3
4 ./3
12 .
Excludes everything names 3.
du --exclude="3"
4 ./1/1
4 ./1
4 ./2/2
4 ./2
8 .
This is what I want to do, just exclude the path 3/3
du --exclude="3/3"
4 ./1/1
4 ./1
4 ./2/2
4 ./2
4 ./3/3
4 ./3
12 .
But it doesn't work with du version 5.2.1. I understand that it's
probably a correct behavior and not a bug, but in tar it's possible to
exclude a path and it would be nice if one could du that in du also.