Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Feb 2004 12:14:41 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Tom Munro Glass <gentoo@tmgcon.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: cp options
Message-ID:  <20040227121441.GE46716@happy-idiot-talk.infracaninophile.co.uk>
In-Reply-To: <200402271712.25786.gentoo@tmgcon.com>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Fri, Feb 27, 2004 at 05:12:24PM +1300, Tom Munro Glass wrote:
> Linux cp has a --link option that makes hard links instead of copies of 
> non-directories. The FreeBSD cp doesn't appear to have that option.
> 
> Is there a way of achieving this?

Yes.  Use find(1)/cpio(1) -- so, to create a 'link tree' of your entire home
directory under /tmp, you would do:

    % cd ${HOME}
    % find . -print | cpio -pvdl /tmp

That assumes that ${HOME} and /tmp are on the same device, which is
probably not true, but you get the general idea.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAPzSxdtESqEQa7a0RApjbAKCCLg3p31RTLnua3BBSaWt4EU6X8wCfVXgt
rGQ48ST7tGC+rh8CgQmazYc=
=WkB5
-----END PGP SIGNATURE-----
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040227121441.GE46716>