Linux (mv or cp) specific files from a text list of files?

I have a directory of many files, something like 50,000 pdf's and other files on a server. I need to move specific ones to another directory. I can generate a list of the files that need to be moved either in csv or any other text format.

What I need to do is run a bash script and move or copy the files that are listed in the text file to another directory.

Is there an easy way of doing this? Any suggestions or resources would be greatly appreciated.


rsync has several options that can take a list of files to process(--files-from, --include-from, etc.).

For example, this will do the trick:

rsync -a /source/directory --files-from=/full/path/to/listfile /destination/directory

In order to avoid a useless use of cat (and if you don't use rsync):

xargs -a file_list.txt mv -t /path/to/dest

This will handle any valid filename, unless it contains a newline, if the files are listed one per line.