How do you copy a file to multiple directories?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Eric Lee Green
Date:  
Subject: How do you copy a file to multiple directories?
Don Calfa wrote:
> I know there is a way to do this with *nix's superior scripting ability
> but I just don't know how.
>
> How can I copy a file to multiple subdirectories?
>
>
> I have a folder that has subdirectories and subdirectories and so on.
>
> /FolderA
> /FolderB1                                            /FolderB2
> /FolderC1_1    /FolderC1_2              /Folder C2_1

>
> I'm toying with gnump3d and I've got it working with PN (sort of) and I
> need to copy the password files to all the directories.


Assuming you want to copy /some/file/somewhere to all directories under
/some/directory, including /some/directory:

cd /some/directory
find . -type d -exec cp /some/file/somewhere '{}' \;

voila.
-- 
Eric Lee Green              
Linux/Unix/Storage Engineer Seeks Job -
   see http://badtux.org for resume