recursively use scp but excluding some folders

后端 未结 6 637
庸人自扰
庸人自扰 2021-01-30 12:25

Assume there are some folders with these structures

/bench1/1cpu/p_0/image/
/bench1/1cpu/p_0/fl_1/
/bench1/1cpu/p_0/fl_1/
/bench1/1cpu/p_0/fl_1/
/bench1/1cpu/p_0         


        
6条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-30 12:53

    You can use extended globbing as in the example below:

    #Enable extglob
    shopt -s extglob
    
    cp -rv !(./excludeme/*.jpg) /var/destination
    

提交回复
热议问题