linux - "xargs -a file" to copy files to a folder -


i tring use xargs -a read contents of file has list of filenames in it.

my directory working in looks like:

backups file1.bak file2.bak file3.bak bakfiles.txt 

file name filenames in it: bakfiles.txt

bakfiles.txt contents:

file1.bak file2.bak file3.bak 

so i'm trying copy file1.bak,file2.bak,file3.bak folder backups. using contents of bakfiles.txt so.

i tried:

xargs -a bakfiles.txt | cp {} backups 

but error:

cp: cannot stat `{}': no such file or directory 

i should mention tried:

xargs -a bakfiles.txt cp {} backups 

and error:

cp: target `file3.bak' not directory 

this works me on windows 7 using mks toolkit version of 'xargs'

cat bakfiles.txt | xargs -i '{}' cp '{}' backups/'{}'


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -