Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Mar 2002 20:02:59 -0600
From:      "Mike Meyer" <mwm-dated-1016071379.3e10b6@mired.org>
To:        "Jon Larssen" <jonlarssen@hotmail.com>
Cc:        questions@freebsd.org
Subject:   Re: find(1) usage
Message-ID:  <15497.27987.227360.616972@guru.mired.org>
In-Reply-To: <1043983@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Jon Larssen <jonlarssen@hotmail.com> types:
> I have a backup directory of some important system files, for instance, 
> backup/etc/master.passwd, backup/etc/groups, etc. Now, if I'm standing just 
> on backup's parent, I can find the files I need to backup, like:
> 
>    find backup/ -name "*" ! -type d -print
> 
> and the result would be
> 
>    backup/etc/master.passwd
>    backup/etc/groups
>    etc.
> 
> Now, I'd like to use the -exec expression of find(1) to obtain the following 
				> (sample) command:

If you have to use exec and cp, you could try this:

	cd backup
	find . ! -type d -exec <....>

Personally, I'd use cpio. See the cpio man page for details on how to
do exactly what you're trying to do.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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