From owner-freebsd-questions@freebsd.org Wed Apr 18 04:21:06 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 858FFF8E0D8 for ; Wed, 18 Apr 2018 04:21:06 +0000 (UTC) (envelope-from freebsd@dreamchaser.org) Received: from nightmare.dreamchaser.org (ns.dreamchaser.org [66.109.141.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "dreamchaser.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01982756A6 for ; Wed, 18 Apr 2018 04:21:05 +0000 (UTC) (envelope-from freebsd@dreamchaser.org) Received: from breakaway.dreamchaser.org (breakaway [192.168.151.122]) by nightmare.dreamchaser.org (8.15.2/8.15.2) with ESMTP id w3I4L3QD032234 for ; Tue, 17 Apr 2018 22:21:04 -0600 (MDT) (envelope-from freebsd@dreamchaser.org) To: FreeBSD Mailing List Reply-To: freebsd@dreamchaser.org From: Gary Aitken Subject: tar xf foo -- how to restore symlink? Message-ID: <5ff313cf-6148-be90-0195-7d21f1f836ac@dreamchaser.org> Date: Tue, 17 Apr 2018 22:20:23 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (nightmare.dreamchaser.org [192.168.151.101]); Tue, 17 Apr 2018 22:21:04 -0600 (MDT) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2018 04:21:06 -0000 I've got a tarball with an archived symlink and its contents. The symlink points to another directory in the tarball, and the tarball contains copies of the files in the symlinked directory. A normal extract fails with the message: $ tar -xf nufraw-0.41.tar.gz nufraw-0.41/doc-pak: Can't replace existing directory with non-directory What's the right way to deal with this? How do I get tar to restore the symlink as a symlink? -k and --exclude allow tar to continue unpacking, but don't restore the symlink as such. "man tar" doesn't seem to have what I want but I'm probably blind. Thanks, Gary