[ale] cp but maintaining path?
Charles Shapiro
hooterpincher at gmail.com
Wed Mar 12 15:34:24 EDT 2008
Actually, the 'flying tar' you mention is approximately how I copy whole
directories from one place to another.
"cp -R dir1 dir2" also works, but it will create dir1 and all
sub-directories in the tree in dir2, so it's a little tricky to get exactly
right sometimes.
-- CHS
On 3/12/08, Greg Freemyer <greg.freemyer at gmail.com> wrote:
>
> All,
>
> I'm trying to do something a little strange.
>
> I am working on a shell script that in the middle of it needs to copy
> files (individually) from dir1 to dir2.
>
> The trouble is that there is directory structure below dir1 that I
> want to recreate in dir2.
>
> Any ideas?
>
> Now that I'm thinking, maybe:
>
> cd dir1
> tar -cf - $relative-path | (cd dir2; tar -xf -)
> cd dir2
>
> I'll go experiment, but if anyone knows a better way or the specific
> args for this way, I would appreciate it.
>
> Thanks
> Greg
> --
> Greg Freemyer
> Litigation Triage Solutions Specialist
> http://www.linkedin.com/in/gregfreemyer
> First 99 Days Litigation White Paper -
> http://www.norcrossgroup.com/forms/whitepapers/99%20Days%20whitepaper.pdf
>
> The Norcross Group
> The Intersection of Evidence & Technology
> http://www.norcrossgroup.com
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20080312/cadb01dd/attachment.html
More information about the Ale
mailing list