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>
References:  <200402271712.25786.gentoo@tmgcon.com>

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

--RpqchZ26BWispMcB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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=
=20
> non-directories. The FreeBSD cp doesn't appear to have that option.
>=20
> 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

--=20
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

--RpqchZ26BWispMcB
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAPzSxdtESqEQa7a0RApjbAKCCLg3p31RTLnua3BBSaWt4EU6X8wCfVXgt
rGQ48ST7tGC+rh8CgQmazYc=
=WkB5
-----END PGP SIGNATURE-----

--RpqchZ26BWispMcB--



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