Exclude a subpath in find command
This question already has an answer here:
Use -prune
to avoid recursing down branches you don't want to follow.
find /mnt/F_11 -name DONOTENTER -prune -o
-type f ( -iname '*.xls' -o -iname '*.xlsx' ) -print
Note the explicit -print
at the end -- this is important, as otherwise the implicit print action covers both branches.
上一篇: 排除搜索整个系统的目录
下一篇: 在find命令中排除子路径