现在的位置: 首页 > 综合 > 正文

find 命令查找不包含的目录和文件

2018年04月08日 ⁄ 综合 ⁄ 共 262字 ⁄ 字号 评论关闭

find 命令查找不包含的目录和文件

exclude files in the find command

find命令常用来查找特定目录下,所有相关文件,可是也经常要排除特定内容的文件/目录,比如不想看svn/cvs的系统文件目录,如何做到呢,明显-name不能解决问题,但是可以用find 的 -not参数,比如查找不包含.svn的所有文件:

java 代码
  1. find . -not -wholename  '*.svn*' -print 
  2. or
  3. find .  ! -wholename  '*.svn*' -print 

再者find经常结合xargs处理复杂的功能

抱歉!评论已关闭.