The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > SUN Solaris
Google UNIX.COM


SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Copy files from a directory by ftp hippa77 UNIX for Dummies Questions & Answers 3 10-06-2007 11:26 AM
copy files with directory structure adddy UNIX for Dummies Questions & Answers 3 12-11-2006 04:50 AM
Copy files from one directory to another HAA Shell Programming and Scripting 1 07-05-2006 11:47 PM
Copy files from one directory to another hd2006 Shell Programming and Scripting 0 06-07-2006 11:29 AM
copy files from one directory to another directory zip_zip UNIX for Dummies Questions & Answers 5 09-14-2003 03:16 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-20-2007
Registered User
 

Join Date: Sep 2007
Posts: 5
Stumble this Post!
Copy files from the file to another directory

I have created a file that has list of all the files I want to copy into another directory.Is there a way to do it?
Thanks In advance
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-20-2007
Registered User
 

Join Date: Nov 2006
Posts: 39
Stumble this Post!
Yes and its quite simple depending how you set up your list of file names. Probably the easiest way is to have the file names listed one per line in the file. Then you can do this in your script.

Code:
cat list | while read filename
...then put the move script in the while loop.
Reply With Quote
  #3 (permalink)  
Old 12-20-2007
Registered User
 

Join Date: Sep 2007
Posts: 5
Stumble this Post!
Thank You! I am still learning unix..If you don't mind,Can you be more specific.
Reply With Quote
  #4 (permalink)  
Old 12-20-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Stumble this Post!
Code:
while read N
do
         cp "$N" target-dir
done <file.lst
Reply With Quote
  #5 (permalink)  
Old 12-20-2007
Registered User
 

Join Date: Dec 2007
Location: Paris
Posts: 342
Stumble this Post!
If the list isn't too large and doesn't contain odd filenames:
Code:
cp $(<list) targetDirectory
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:54 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0