I have a list of filenames called list.txt.
I would like to copy the files in this list to a new folder.
How should I go about doing this?
Thanks!
|
I have a list of filenames called list.txt. I would like to copy the files in this list to a new folder. How should I go about doing this? Thanks! |
|||||
|
|
You can do this:
Note that you should avoid having spaces in your filenames when using this (another solution would be needed if this is the case). The backticks execute the |
|||||||||||||
|
|
use a loop
|
|||||||||
|
|
If you want to preserve directory structure, use one of these (assuming GNU tar):
In both cases, the net result is that /destination is prefixed to the names of the files in list.txt. |
|||
|
|
|
loop:
Tested. Make sure "./list.txt" exists, otherwise manually fill in the absolute path. :) |
|||||||||
|