Bash: Loop over files listed in a text file and move them

后端 未结 6 1394
慢半拍i
慢半拍i 2021-02-15 00:01

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 o

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-15 00:14

    you can move 1000 or 1000 user directory without take much time where thousand of user directory exist.

    cat deleteduser | while read i;  do mv -vv $i ../deleted_user; done; 
    deleteuser= user name list
    ../deleted_user= destination dir
    

提交回复
热议问题