LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Creating a script to move or copy files into multiple directories below the files (https://www.linuxquestions.org/questions/linux-newbie-8/creating-a-script-to-move-or-copy-files-into-multiple-directories-below-the-files-750147/)

matthes138 08-25-2009 12:19 PM

Creating a script to move or copy files into multiple directories below the files
 
How can you create a script to move or copy files from a main directory into multiple directories below the main directory.

catkin 08-25-2009 12:23 PM

Is this homework? Have you had any ideas about how it might be done?

Tinkster 08-25-2009 12:34 PM

Quote:

Originally Posted by matthes138 (Post 3657026)
How can you create a script to move or copy files from a main directory into multiple directories below the main directory.

tee springs to mind ... :}

matthes138 08-25-2009 04:27 PM

files are in the top dir.
test#
|
Dir1
|
Dir2
|
Dir3
Copy files from test into each of the directories below the test directory
This isnt a homework assignment and I dont see how tee will do this? Please can you give an example?

catkin 08-25-2009 04:53 PM

Have you any ideas about how to do this? Which commands may be useful?

Tinkster 08-25-2009 04:57 PM

Quote:

Originally Posted by matthes138 (Post 3657335)
files are in the top dir.
test#
|
Dir1
|
Dir2
|
Dir3
Copy files from test into each of the directories below the test directory
This isnt a homework assignment and I dont see how tee will do this? Please can you give an example?

Code:

cat file | tee Dir1/file Dir2/file > Dir3/file


All times are GMT -5. The time now is 05:14 PM.