[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Copy all except one



Hi,

Russell wrote:

> Hi,
> 
> I want to copy everything from hda2 to hdd2, where
> hdd2 is mounted as /mnt on hda2.
> 
> I think a cp recursive would cause a loop, so can i
> exclude /mnt easily, or would i need to make a bash
> script?

You might want to try the -x option of cp.  cp will only copy the
contents of one filesystem and will not recurse through mount points.
See the man page.

Ciao,
Viktor
-- 
Viktor Rosenfeld
WWW: http://www.informatik.hu-berlin.de/~rosenfel/

Attachment: pgp_auEjtB3sP.pgp
Description: PGP signature


Reply to: