From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 21 20:50:11 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 871D816A41F for ; Wed, 21 Dec 2005 20:50:11 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id C55DE43D53 for ; Wed, 21 Dec 2005 20:50:10 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id jBLKo9FU072805; Wed, 21 Dec 2005 14:50:09 -0600 (CST) (envelope-from dan) Date: Wed, 21 Dec 2005 14:50:09 -0600 From: Dan Nelson To: Ashok Shrestha Message-ID: <20051221205009.GD17476@dan.emsphone.com> References: <79e2026f0512211237i4cdd2c70yc0923959d7ec1c98@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <79e2026f0512211237i4cdd2c70yc0923959d7ec1c98@mail.gmail.com> X-OS: FreeBSD 5.4-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.11 Cc: hackers@freebsd.org Subject: Re: copy directory structure X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2005 20:50:11 -0000 In the last episode (Dec 21), Ashok Shrestha said: > Do you know how to copy just a directory structure (not the files > inside it)? One way would be using mtree: "mtree -d -c -p /path | mtree -U -p /otherpath". You could also do it with find and tar: "cd /path ; find . -type d | tar Tcfn - - | ( cd /otherpath ; tar xf - )" -- Dan Nelson dnelson@allantgroup.com