On 2021-05-05 11:28-0400 "Walter Dnes" wrote: > On Wed, May 05, 2021 at 04:03:03PM +0200, tastytea wrote > > > > This works fine here with ???tar (GNU tar) 1.34???: > > > > $ mkdir -p a/b > > $ touch a/file a/b/file > > $ touch a/file.xz a/b/file.xz > > $ tree a > > a > > ????????? b > > ???   ????????? file > > ???   ????????? file.xz > > ????????? file > > ????????? file.xz > > > > 1 directory, 4 files > > $ tar -cvzf test.tar.gz --exclude="a/file" --exclude="a/b/*.xz" a > > That's files. What happens with directories, e.g. > tar -cvzf test.tar.gz --exclude="a/b/" a With the trailing slash it doesn't work, but `tar -cvzf test.tar.gz --exclude="a/b" a` works. > I know I followed the manual. Actually, my problem seems to be with > directories. See > https://serverfault.com/questions/742514/running-the-tar-command-with-the-exclude-functionality-does-not-work-for-direc > where someone finds that... > > tar hczf t.tar.gz * --exclude="./test1" > > ...doesn't work, but... > > tar --exclude="./test1" -hczf t.tar.gz * > > ...does work!?!?!? > That's because the files come last, the poster of the question has put --exclude after the files. When I'm in a, --exclude="./b" doesn't work, but --exclude="b" works. tar doesn't seem to understand “./”. -- Get my PGP key with `gpg --locate-keys tastytea@tastytea.de` or at .