[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: question: copy command
- From: Bob McClure Jr <robertmcclure earthlink net>
- To: Getting started with Red Hat Linux <redhat-install-list redhat com>
- Subject: Re: question: copy command
- Date: Thu, 9 Dec 2004 16:30:34 -0600
On Thu, Dec 09, 2004 at 05:14:17PM -0500, GoijI P wrote:
> please, what's best and least risky command to copy contents of directory
> /dir to /Mydir?.
This assumes you want a recursive copy.
mkdir /Mydir # if it doesn't exist already
cd /dir
find . -depth -mount | cpio -pdmv /Mydir
That will not overwrite any files of the same name in /Mydir if their
timestamps are newer than the corresponding files in /dir. If you
want to force it, add the "u" (unconditional overwrite) option to the
cpio command.
If executed as root, ownership of the copied files in /Mydir will
be the same as they were in /dir. If executed as your mere mortal
self, the new files in /Mydir will be owned by you.
Cheers,
--
Bob McClure, Jr. Bobcat Open Systems, Inc.
robertmcclure earthlink net http://www.bobcatos.com
Grace happens.
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]