I have a file with a list of file names. I want to find each of those files and copy it to some directory, is this possible in linux?
ListOfFileNames.txt
xyz.txt
ags.txt
shd.txt
...
Directory_to_be searched
dsf.txt
xyz.txt
shd.txt
...
Empty_new_directory
So copy xyz.txt, ags.txt, shd.txt and place them in Empty_new_directory
Any help will be appreciated
xargs cp -t /app/dest/ < ListOfFileNames.txt
Does not work?
Maybe use of find command
If there's no nesting, then you can use a simple loop with
cp
: