Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Mar 2006 21:43:51 +0300
From:      "Andrew Pantyukhin" <infofarmer@gmail.com>
To:        "Jonathan Horne" <sharazjek@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: best way to use cp?
Message-ID:  <cb5206420603251043gac893f3l7c7ff66b05d7bf41@mail.gmail.com>
In-Reply-To: <b2195ee20603241038w7be2ba47hc18889dd139f2d52@mail.gmail.com>
References:  <b2195ee20603241038w7be2ba47hc18889dd139f2d52@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 3/24/06, Jonathan Horne <sharazjek@gmail.com> wrote:
> ok, tell them dumb linux user how to properly copy directories recursivly=
,
> so he can stop overwritng directories with source files.
>
> /humor
>
> ok seriously, tho, i think im doing it wrong.  last night i blasted some
> directories, and when i looked at the destination of where i was supposed=
 to
> be copying to, it was full of all kinds of junk that was supposed to be i=
n
> the top level of the directories i was copying.
>
> example, i want to copy /mnt/usb1/path/oldfolder  (the folded all its
> recursive contents) into /home/mydir
>
> im pretty sure i have the syntax wrong, so could someone enlighten me?
>
> thanks!
> jonathan
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o=
rg"
>

>From cp(1):

"-R    If source_file designates a directory, cp copies the directory and
the entire subtree connected at that point.  If the source_file
ends in a /, the contents of the directory are copied rather than
the directory itself.  This option also causes symbolic links to be
copied, rather than indirected through, and for cp to create spe-
cial files rather than copying them as normal files.  Created
directories have the same mode as the corresponding source direc-
tory, unmodified by the process' umask."

Read the rest of the story in the manpage.



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