How to move or copy files listed by 'find' command in unix?

后端 未结 5 1788
一向
一向 2020-11-30 23:28

I have a list of certain files that I see using the command below, but how can I copy those files listed into another folder, say ~/test?

find . -mtime 1 -ex         


        
5条回答
  •  粉色の甜心
    2020-12-01 00:17

    This is the best way for me:

    cat filename.tsv  |
        while read FILENAME
        do
        sudo find /PATH_FROM/  -name "$FILENAME" -maxdepth 4 -exec cp '{}' /PATH_TO/ \; ;
        done
    

提交回复
热议问题