From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 23 19:56:24 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 466CA16A41F for ; Fri, 23 Dec 2005 19:56:24 +0000 (GMT) (envelope-from julian@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id C337943D81 for ; Fri, 23 Dec 2005 19:56:23 +0000 (GMT) (envelope-from julian@elischer.org) Received: from unknown (HELO [10.251.17.229]) ([10.251.17.229]) by a50.ironport.com with ESMTP; 23 Dec 2005 11:56:23 -0800 X-IronPort-Anti-Spam-Filtered: true Message-ID: <43AC5666.8030702@elischer.org> Date: Fri, 23 Dec 2005 11:56:22 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.11) Gecko/20050727 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ashok Shrestha References: <79e2026f0512211237i4cdd2c70yc0923959d7ec1c98@mail.gmail.com> <200512221513.jBMFDqE7002532@lurza.secnetix.de> <79e2026f0512231152n6cc15460ifa28076ca464d23e@mail.gmail.com> In-Reply-To: <79e2026f0512231152n6cc15460ifa28076ca464d23e@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-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: Fri, 23 Dec 2005 19:56:24 -0000 Ashok Shrestha wrote: >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 inside 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 >> >> add -depth e.g. cd $SRC; find . -type d -depth | cpio -dumpl $DST that ensures that the timestamps on the directories are correct too. (if that matters) >>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 >_______________________________________________ >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" > >