Possible Duplicate:
Manipulate file name piped from find command
How can I alter the path of a file found with find
before I run an exec
on it? I want to find files and then mv
them to a mounted file system that has the same file structure as the system being searched.
Say I found ./home/usr1/dir1/file
, I want to move it to /mountedSystem/home/usr1/dir1/file
, so all I need is to remove the leading .
and append /mountedSystem
to the start of the file path before executing the mv
. Is there any way to do this safely?
find
command?rsync
instead offind ... -exec
.rsync
synchronizes file systems/directoriesfind
or does it sync the whole system?