使用find 排除 

找到./tools/dbsetup/startlibs/config/suconfig/ 下除了以下文件名的文件

find ./tools/dbsetup/startlibs/config/suconfig/ ! -name 'su_aa.json' \
! -name 'su_aip.json' \
! -name 'su_bc.json'  \
! -name 'su_design.json'  \
! -name 'su_df.json' \
! -name 'su_df_view.json'   \
! -name 'su_gl.json'  \
! -name 'su_sys.json' 

2 加-exec调用删除

find ./tools/dbsetup/startlibs/config/suconfig/ ! -name 'su_aa.json' \
! -name 'su_aip.json' \
! -name 'su_bc.json'  \
! -name 'su_design.json'  \
! -name 'su_df.json' \
! -name 'su_df_view.json'   \
! -name 'su_gl.json'  \
! -name 'su_sys.json' -exec rm -f {} +

{} 标识find命令找到的文件

结束符有两种   ; 和 +

;会对每个找到item执行command

+ 会执行一次

-exec rm -f {} +   执行 rm -f 1 2 3 等同于
-exec rm -f {} \; 执行 rm -f 1 \ rm -f 2 \ rm -f 3
\的作用是防止截断

 3 目录中查找记得排除 .和当前查找的目录

find ./jstack/apps -maxdepth 1 -typd d ! -name '.' ! -name 'apps'

 

相关文章:

  • 2021-11-23
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2021-08-15
  • 2022-12-23
猜你喜欢
  • 2021-06-15
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2022-01-03
相关资源
相似解决方案