LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-25-2009, 12:19 PM   #1
matthes138
LQ Newbie
 
Registered: May 2009
Posts: 6

Rep: Reputation: 0
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.
 
Old 08-25-2009, 12:23 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,551
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Is this homework? Have you had any ideas about how it might be done?
 
Old 08-25-2009, 12:34 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,986
Blog Entries: 11

Rep: Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880
Quote:
Originally Posted by matthes138 View Post
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 ... :}
 
Old 08-25-2009, 04:27 PM   #4
matthes138
LQ Newbie
 
Registered: May 2009
Posts: 6

Original Poster
Rep: Reputation: 0
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?
 
Old 08-25-2009, 04:53 PM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,551
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Have you any ideas about how to do this? Which commands may be useful?
 
Old 08-25-2009, 04:57 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,986
Blog Entries: 11

Rep: Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880
Quote:
Originally Posted by matthes138 View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy files from multiple directories into one directory MadRabbit Linux - Newbie 8 02-07-2014 07:56 PM
How to copy one file and to multiple directories using shell script? cebuy Programming 8 03-31-2009 07:04 PM
Very simple shell script - move files to different directories beley Programming 7 11-02-2006 05:24 AM
Move certain files into different directories facets Programming 6 05-28-2004 01:20 PM
find and copy files into multiple directories avargas22 Linux - Newbie 2 04-01-2004 11:11 AM


All times are GMT -5. The time now is 04:42 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration