From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 23 19:52:56 2005 Return-Path: X-Original-To: freebsd-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 9542516A41F for ; Fri, 23 Dec 2005 19:52:56 +0000 (GMT) (envelope-from ashok.shrestha@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6824443D58 for ; Fri, 23 Dec 2005 19:52:55 +0000 (GMT) (envelope-from ashok.shrestha@gmail.com) Received: by wproxy.gmail.com with SMTP id i31so669834wra for ; Fri, 23 Dec 2005 11:52:54 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=lVNmUYGHLMN0DxjaXKCs7njR6ZraWk5I68e6FfGXp9lGdbdVPaGexkft6zWE3LvrNZdAmE1ozHrlskxDzhGYsOZXSkGQEmn4RnPlcH1pzQRpDsxwGgUyYF0/r8G3YW8g04zWJvw3/mELuim95okhubl2JKWKF3xb6ZWQtSE5htc= Received: by 10.54.113.6 with SMTP id l6mr4065794wrc; Fri, 23 Dec 2005 11:52:54 -0800 (PST) Received: by 10.54.127.14 with HTTP; Fri, 23 Dec 2005 11:52:54 -0800 (PST) Message-ID: <79e2026f0512231152n6cc15460ifa28076ca464d23e@mail.gmail.com> Date: Fri, 23 Dec 2005 14:52:54 -0500 From: Ashok Shrestha To: freebsd-hackers@freebsd.org In-Reply-To: <200512221513.jBMFDqE7002532@lurza.secnetix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <79e2026f0512211237i4cdd2c70yc0923959d7ec1c98@mail.gmail.com> <200512221513.jBMFDqE7002532@lurza.secnetix.de> 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: Fri, 23 Dec 2005 19:52:56 -0000 Thank you All. On 12/22/05, Oliver Fromme wrote: > Ashok Shrestha wrote: > > Do you know how to copy just a directory structure (not the files insi= de it)? > > The following is probably the easiest and most efficient way > ($SRC and $DST are the source and destination directories): > > cd $SRC; find . -type d | cpio -dumpl $DST > > It will also preserve permission modes and ownerships (if > run as root). The command is even portable to other UNIX > systems (it's not BSD-specific). If you suspect that there > are filenames that could contain newline characters, use > find's -print0 option and cpio's -0 option, but those are > not portable. > > Best regards > Oliver > > -- > Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing > Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd > Any opinions expressed in this message may be personal to the author > and may not necessarily reflect the opinions of secnetix in any way. > > "A language that doesn't have everything is actually easier > to program in than some that do." > -- Dennis M. Ritchie > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " > -- Ashok Shrestha