Bash: Loop over files listed in a text file and move them
I have a directory (directory A) with 10,000 files in it. I want to move some of them to directory B and the others to directory C. I made a text file that contains the names of all the files I want to move to directory B and another one with the names of all the files that I want to move to directory C. How can I write a bash for loop to move these files to the new directories. Pseudocode: for file in textfileB: move file from directory A to directory B for file in textfileC: move file from directory A to directory C Sorry if this is asked somewhere else, but I've spent hours trying to learn