From owner-freebsd-questions@FreeBSD.ORG Mon Jul 13 07:02:40 2009 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 005A61065670 for ; Mon, 13 Jul 2009 07:02:39 +0000 (UTC) (envelope-from modulok@gmail.com) Received: from mail-ew0-f206.google.com (mail-ew0-f206.google.com [209.85.219.206]) by mx1.freebsd.org (Postfix) with ESMTP id 5361B8FC1C for ; Mon, 13 Jul 2009 07:02:39 +0000 (UTC) (envelope-from modulok@gmail.com) Received: by ewy2 with SMTP id 2so1932566ewy.36 for ; Mon, 13 Jul 2009 00:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=7onyb8n6t2Vm8FAywSDTcmnMztCnfG8F7c7PzPFpoOI=; b=wDsK5M65z/o/aNORj2/to05zoNIw8+V8HH38ZdOoW7vwXLMqZcPXBl1I+ajBzW6Y/U dwxXdjdm7C6yK/zvfHCejUT4qN3fQ58921nBO5rFv9HPSQnObmFtbjlezhWEkWdHfCWp s0cnsetsUyDlyGaXKOhz7/F6nYU29AD+v4Vc4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=LUg23rafnpKwHgetlQZCs4IuYoULGSEbgpzfqP7p8cVc3Sd653Y1Jbl9dF0dfmAiOn PI2Ax/U9KGf4APQuLBLRktRRdcfibiqSdXzN7hglR7gmsmAsz72mhFUVvOMnp3ziuuEy mff4Vdr3ILkotywdNYI2RiTGfz1NAJfBBE2KQ= MIME-Version: 1.0 Received: by 10.210.137.18 with SMTP id k18mr4462978ebd.47.1247468558417; Mon, 13 Jul 2009 00:02:38 -0700 (PDT) Date: Mon, 13 Jul 2009 01:02:38 -0600 Message-ID: <64c038660907130002i73a95d9bq9224373b5ff89f08@mail.gmail.com> From: Modulok To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Copy directory tree as hard links... 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: Mon, 13 Jul 2009 07:02:40 -0000 What is the easiest way to copy a directory tree as hard links? Linux has a nice little 'cp -al' flag combo to do this. The FreeBSD cp(1) manual page says to use pax or tar, but how do I get the ability to rename the file without first creating a destination file? I don't want an archive, just regular directory tree sitting right next to the original, but with a new name ... consisting of of hard links back to the original. For example on linux I could do something like: $ ls foo/ $ cp -al foo bar The result would be a new copy of foo, which takes up no additional space, as all files share the same inodes. Is there an easy way to do this on FreeBSD? Thanks! -Modulok-