Copy directory subsets?

Nathan England nathan at paysonlinux.org
Tue Jun 6 21:16:43 MST 2006


cp -ruv source/{file2,file3,dir1/file3} destination/

Would that work?

Nathan

On Tuesday 06 June 2006 21:08, Alan Dayley wrote:
> This is a problem that has bugged me for a while and I just have to ask.
>
> Directory 'destination' contains:
> file1
> file2
> file3
> file4
> Dir1
>   dir1file1
>   dir1file2
>   dir1file3
>
> Directory 'source' contains:
> file2
> file3
> Dir1
>   dir1file3
>
> I want to copy the entire 'source' directory into 'destination' such
> that 'source/file2' 'source/file3' and 'source/Dir1/dir1file3' overwrite
> the existing files in 'destination'.
>
> A normal 'cp' or 'mv' or drag and drop in Konqueror is fine for 'file2'
> and 'file3'.  But it will wipe out the 'destination/Dir1' replacing it
> with the 'source/Dir1' that only has one file in it.  I want a copy
> operation that will overwrite 'destination/Dir1/dir1file3' while leaving
> the other files in the directory in place.
>
> Does that make sense?
>
> Anybody know how to do this?  Am I simply missing a copy
> command/operation option?
>
> Alan
>
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change  you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

-- 

--------------------------------------------------------------
PaysonLinux User Group
Community Based Linux Support
http://www.paysonlinux.org/

Business Consulting Services,
Advanced Network and Server Design,
Security Solutions,
Process Management and Efficiency Consultations


More information about the PLUG-discuss mailing list