BASH copy all files except one

后端 未结 8 575
逝去的感伤
逝去的感伤 2020-11-30 19:13

I would like to copy all files out of a dir except for one named Default.png. It seems that there are a number of ways to do this. What seems the most effective to you?

8条回答
  •  抹茶落季
    2020-11-30 19:31

    I'd just do:

    cp srcdir/* destdir/ ; rm destdir/Default.png
    

    unless the files are big. Otherwise use e.g.

    find srcdir -type f/ |grep -v Default.png$ |xargs -ILIST cp LIST destdir/
    

提交回复
热议问题