From owner-freebsd-questions@FreeBSD.ORG Tue Feb 28 18:51:34 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C073F106566B for ; Tue, 28 Feb 2012 18:51:34 +0000 (UTC) (envelope-from fbsdq@peterk.org) Received: from poshta.pknet.net (poshta.pknet.net [216.241.167.213]) by mx1.freebsd.org (Postfix) with ESMTP id 95BC88FC0A for ; Tue, 28 Feb 2012 18:51:34 +0000 (UTC) Received: from poshta.pknet.net (localhost [127.0.0.1]) by poshta.pknet.net (Postfix) with ESMTP id A40C51471B for ; Tue, 28 Feb 2012 11:51:32 -0700 (MST) Received: from poshta.pknet.net ([127.0.0.1]) by poshta.pknet.net (poshta.pknet.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id To7XurHUt7To for ; Tue, 28 Feb 2012 11:51:28 -0700 (MST) Received: from pop.pknet.net (localhost [127.0.0.1]) by poshta.pknet.net (Postfix) with ESMTP id E42371395F for ; Tue, 28 Feb 2012 11:51:27 -0700 (MST) Received: from 74.63.162.21 (SquirrelMail authenticated user fbsdq@peterk.org) by pop.pknet.net with HTTP; Tue, 28 Feb 2012 11:51:27 -0700 Message-ID: <836b68e817a2b27b77ab82dbfadf45ca.squirrel@pop.pknet.net> Date: Tue, 28 Feb 2012 11:51:27 -0700 From: "Peter" To: freebsd-questions@freebsd.org User-Agent: SquirrelMail/1.4.22 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: tar --exclude not working X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 18:51:34 -0000 Hello, Ran into a weird issue where the 'exclude' pattern to tar isn't matching correctly: pkbsd:$find ./ ./ ./file ./dir1 ./dir1/file ./dir2 ./dir2/file This is expected: pkbsd:$tar Jcvf /tmp/tar.test ./ a . a ./file a ./dir1 a ./dir2 a ./dir2/file a ./dir1/file This is correct: pkbsd:$tar --exclude './dir2/file' -Jcvf /tmp/tar.test ./ a . a ./file a ./dir1 a ./dir2 a ./dir1/file Here I want to _only_ exlude './file', NOT ./dir?/file pkbsd:$tar --exclude './file' -Jcvf /tmp/tar.test ./ a . a ./dir1 a ./dir2 Anyway to exclude just './file' ? If I specify full path, it works as expected: pkbsd:$tar --exclude "home/peter/t/blah/file" -Jcvf /tmp/tar.test /home/peter/t/blah tar: Removing leading '/' from member names a home/peter/t/blah a home/peter/t/blah/dir1 a home/peter/t/blah/dir2 a home/peter/t/blah/dir2/file a home/peter/t/blah/dir1/file Why not relative './file' ? ['\./file' also does not work]. ]Peter[