Date: Mon, 13 Jul 2009 01:02:38 -0600 From: Modulok <modulok@gmail.com> To: freebsd-questions@freebsd.org Subject: Copy directory tree as hard links... Message-ID: <64c038660907130002i73a95d9bq9224373b5ff89f08@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
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-
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?64c038660907130002i73a95d9bq9224373b5ff89f08>