Unix: copy batch of files (filenames in text file) to another directory Unix: copy batch of files (filenames in text file) to another directory unix unix

Unix: copy batch of files (filenames in text file) to another directory


This should make it:

while read filedo   file=$(echo $file | tr -d '\\r')   cp dir/$file another_dir/done < your_file


In Bash you can also use:

for f in `cat file` ; do cp $f destination ; done


This should work....it depends on how long the filenames are.

cp `cat text-file` target_directory