Reputation: 3186
I am using linux, I have a file containing nearly 90 filenames of files from various locations in my HDD. I want to copy those files to a USB drive, how could i do that? The file containing filenames is in the following format :
file1
file2
.
.
.
filen
I think a shell script could do that easily , but since i'm a beginner I don't know how to write it. Please provide a solution.
Upvotes: 0
Views: 176
Reputation: 3582
You have to know the path to the usb drive. Then the copy command looks like
cp somefile tolocation
you'd need to put this in a loop that read the file
while read line
do
echo $line;
echo "do your copy here, for example cp $line /tmp/"
done < "yourfile"
Upvotes: 2