I have nearly 4 lakhs (400,000) of files in a folder named
model and from this folder I have selected a few thousand files and their names are saved in
id.txt. Now I want to take only the files listed in
id.txt from the folder
model and copy them to another folder named
The two folders are present inside the same directory
test which contains
id.txt contains filenames one by one
ENSP00000290866.4_2.pdb.xz 385719215_2.pdb.xz GENSCAN00000006392_3.pdb.xz
Model folder contains nearly 3 lakh files
ENSP00000290866.4_2.pdb.xz 385719215_2.pdb.xz GENSCAN00000006392_3.pdb
*note: in folder some files have .pdb.xz extension and some only .pdb
I know how to copy a single file from one folder to another like this
cp model/ENSP00000290866.4_2.pdb.xz selected_ids/
But I have thousands and thousands of files to copy in short time.
Can anyone give some efficient command to copy the files?