Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Copy single file to multiple directories Post 302144830 by kthatch on Saturday 10th of November 2007 10:45:08 AM
Old 11-10-2007
Copy single file to multiple directories

Please help - I need to copy a single file to multiple directories.

Dir structure:

Parent_Directoy
Filename1
Child_Directory1
Child_Directory2
Child_Directory3
Child_Directory4
....

So I need to copy Filename1 to all of the Child_Directories.

Currently I do it one by one via
cp Filename1 Child_Directory1/
cp Filename1 Child_Directory2/
....
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

copy multiple files in different directories

I have a report file that is generated every day by a scheduled process. Each day the file is written to a directory named .../blah_blah/Y07/MM-DD-YY/reportmmddyy.tab I want to copy all of this reports to a separate directory without having to do it one by one. However, if I try cp... (3 Replies)
Discussion started by: ken2834
3 Replies

2. UNIX for Dummies Questions & Answers

Copy file into directories and sub-directories

Hello- I need to copy a file into multiple directories, and each directory's sub-directories (of which there are 5) Currently, the parent directory is set up like this: dir1 sub-dir1 sub-dir2 sub-dir3 sub-dir4 sub-dir5 dir2 sub-dir1 sub-dir2 sub-dir3 ... (1 Reply)
Discussion started by: penlok
1 Replies

3. Shell Programming and Scripting

rsync multiple directories into single directory on remote

I would like to find and backup all *.mp4 files from /Pictures and its sub-directories and move them to a single directory on a remote. I can find and move the files but I don't want the directory structure...just the files to be placed in a single remote directory. To find my files I use ... (1 Reply)
Discussion started by: wreckedred
1 Replies

4. Shell Programming and Scripting

Copy one folder to multiple directories

Hello, I have a small question and i hope someone can help me, if i have 200 domains directories in my server under this directory something like now how i can copy one folder i have to this directories? Thank You (5 Replies)
Discussion started by: GamGom
5 Replies

5. Shell Programming and Scripting

Copy files from multiple directories into one directory without overwriting them

I have several directories and all those directories have .dat files in them. I want to copy all those .dat files to one directory say "collected_directory" The problem is I don't want to overwrite files. So, if two file names match, I don't want the old file to be overwritten with a new one. ... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

6. Shell Programming and Scripting

Copy files/directories excluding multiple paterns

my directory structure is like below: basedir\ p.txt q.htm r.java b\ abc.htm xyz.java c\ p.htm q.java rst.txt my requirement is i want to copy all the files and directories... (0 Replies)
Discussion started by: ajayyadavmca
0 Replies

7. UNIX for Dummies Questions & Answers

copy file using unix in multiple directories

Hi All Genious, I want to copy a file name XYZ .In a directory /HOME/dir/IXOS1/dir1 which contain multiple directories named not in pattern want to copy the XYZ in all of the directories available on path /HOME/dir/IXOS1/dir1 . Thanks in advance . (2 Replies)
Discussion started by: mumakhij
2 Replies

8. Shell Programming and Scripting

Single script to create multiple directories

Hi , I want a script to create a directories at different locations. suppose i am on home/path/zone1. I want to create a directory of current month in this location. Then i want to create the same current month directory in home/path/zone2.like this for 9 diffrent zones. I can do this... (4 Replies)
Discussion started by: sv0081493
4 Replies

9. Shell Programming and Scripting

Copy local files to single remote host but multiple folders using rsync

I'm trying to copy a file myfile.scr from my local Linux server to multiple folders on remote AiX server using single rsync command. Below command helps me copy the file "myfile.scr" from my localhost to a remote host folder "/app/deployment/tmpfiles" rsync --delay-updates -F --compress... (1 Reply)
Discussion started by: mohtashims
1 Replies

10. UNIX for Beginners Questions & Answers

How to copy particular files from a multiple directories and paste in a new directory?

Dear all I have a multiple directories, say for example org1, org2, org3 ..... org100 and each directory having a file namely dnaG.fasta. I need to copy all the dnaG.fasta file from each directory and paste in another directory fastconcatg. Therefore, my script has to copy dnaG.fasta file from... (5 Replies)
Discussion started by: dineshkumarsrk
5 Replies
ost::Dir(3)						     Library Functions Manual						       ost::Dir(3)

NAME
ost::Dir - A low level portable directory class. SYNOPSIS
#include <file.h> Inherits ost::File. Public Member Functions Dir (const char *name=NULL) void open (const char *name) void close (void) virtual ~Dir () const char * getName (void) const char * operator++ () const char * operator++ (int) const char * operator* () bool rewind (void) bool operator! () bool isValid (void) Static Public Member Functions static bool create (const char *path, Attr attr=attrGroup) static bool remove (const char *path) static bool setPrefix (const char *path) static bool getPrefix (char *path, size_t size=256) Additional Inherited Members Detailed Description A low level portable directory class. Used to support ccstd Directory container. This provides a basic mechanism for allocating and accessing file entries. Author: David Sugar dyfet@ostel.com low level directory access class. Constructor &; Destructor Documentation ost::Dir::Dir (const char *name = NULL) virtual ost::Dir::~Dir () [virtual] Member Function Documentation void ost::Dir::close (void) static bool ost::Dir::create (const char *path, Attrattr = attrGroup) [static] const char* ost::Dir::getName (void) static bool ost::Dir::getPrefix (char *path, size_tsize = 256) [static] bool ost::Dir::isValid (void) void ost::Dir::open (const char *name) bool ost::Dir::operator! () [inline] const char* ost::Dir::operator* () const char* ost::Dir::operator++ () [inline] const char* ost::Dir::operator++ (int) [inline] static bool ost::Dir::remove (const char *path) [static] bool ost::Dir::rewind (void) static bool ost::Dir::setPrefix (const char *path) [static] Author Generated automatically by Doxygen for GNU CommonC++ from the source code. GNU CommonC++ Sat Jun 23 2012 ost::Dir(3)
All times are GMT -4. The time now is 06:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy