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

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.

cat list | while read filename

...then put the move script in the while loop.

Thank You! I am still learning unix..If you don't mind,Can you be more specific.

while read N
do
         cp "$N" target-dir
done <file.lst
1 Like

If the list isn't too large and doesn't contain odd filenames:

cp $(<list) targetDirectory