Asking cp to copy preserving the whole source path.
cp (GNU coreutils 6.9).
Hi: I have these files: Code:
/usr/lib/seamonkey-1.1.2/defaults/profile/US/mimeTypes.rdf Code:
/xp/borrar/usr/lib/seamonkey-1.1.2/defaults/profile/US/mimeTypes.rdf |
I am not sure cp alone can do this stuff.. But a simple solution in my mind..
mkdir -p /xp/borrar/usr/lib/seamonkey-1.1.2/defaults/profile/US mkdir -p /xp/borrar/home/semoi/.mozilla/firefox/u88mwxdz.default/ cp -pr /usr/lib/seamonkey-1.1.2/defaults/profile/US/mimeTypes.rdf /xp/borrar/usr/lib/seamonkey-1.1.2/defaults/profile/US/ cp -pr /home/semoi/.mozilla/firefox/u88mwxdz.default/mimeTypes.rdf /xp/borrar/home/semoi/.mozilla/firefox/u88mwxdz.default/ Dont' whether it will suffice your need. --Rameez |
Try the --parents option of cp, that is designed exactly for the this behavior. In alternative you can always try rsync instead of cp.
|
Thanks for your reply. Yes, but you'll see: in fact, the number of files to copy is quite large and so, I'd need a more automated procedure. Regards.
|
Quote:
Code:
echo /home/semoi/.mozilla/firefox/u88mwxdz.default/mimeTypes.rdf | cpio -pamVd /xp/borrar [edit]Just saw responses posted between me clicking quote and finishing my post; use find instead of echo to feed many filenames if the dir tree is complex.[/edit] Cheers, Tink |
colucix, either I made a very easy question or you provided a very clever answer.
Code:
bash-3.1$ mkdir pruebo |
Quote:
after an update makes perfect sense ;} ... thanks, colucix. Cheers, Tink |
good one..
keep going.. :) |
All times are GMT -5. The time now is 10:08 AM. |