linux find 命令避开某个目录的用法prune
来源:互联网 发布:购物分享php系统 编辑:程序博客网 时间:2024/05/21 07:13
如果想查找当前目录(/home/student)下的tmp.txt文件,但是想要避开sep目录:
find /home/student -path /home/student/sep -prune -o -name "tmp.txt" -print
sep后面不能加/ 即/home/student/sep/是错误的 如果当前目录为/home/student 也可以这样
find . -path ./sep -prune -o -name "tmp.txt" -print
总结:-path 只是匹配find出来的路径,可以通过使用匹配符号* [] ?等 例如:
[student@bioeng ~]$ find . -name file
./file
./dir/file
./dir/dir555/file
./dir/dir2/file
./dir/dir1/file
[student@bioeng ~]$
[student@bioeng ~]$ find . -path "*dir[12]" -prune -o -name file -print
./file
./dir/file
./dir/dir555/file
[student@bioeng ~]$ [student@bioeng ~]$ find . -path "*dir*" -prune -o -name file -print
./file
[student@bioeng ~]$
转自: http://blog.csdn.net/imfinger/article/details/6371601
0 0
- linux find 命令避开某个目录的用法prune
- linux find 命令避开某个目录的用法prune
- find命令的-prune参数的使用
- Linux的find命令忽略某个目录的查找
- find命令纪录 prune
- linux find prune exec 排除某目录或文件 执行
- linux find prune exec 排除某目录或文件 执行
- linux find prune exec 排除某目录或文件 执行
- linux find prune exec 排除某目录或文件 执行
- linux find 命令忽略某个或多个子目录的方法
- Linux命令 find和mv的结合使用:查找文件,移动到某个目录
- linux find 命令忽略某个或多个子目录的方法
- Linux命令 find和mv的结合使用:查找文件,移动到某个目录
- Linux命令 find和mv的结合使用:查找文件,移动到某个目录
- linux find 命令忽略某个或多个子目录的方法
- linux find 命令忽略某个或多个子目录的方法
- linux find 命令忽略某个或多个子目录的方法
- linux find 命令忽略某个或多个子目录的方法 【转】
- HBase技术介绍
- 西安80后大学老师离奇失踪 疑房贷等压力大
- JavaWeb入门实战—Request&Response
- webservice的学习笔记(一)
- 设置Ubuntu的FQDN
- linux find 命令避开某个目录的用法prune
- 中纪委邀网民晒隐形“四风” 曝改头换面腐败手段
- kX3552常用插件集
- Java之MS SQL数据库连接
- Android学习之图像的处理
- 养成一个SQL好习惯带来一笔大财富
- 深入理解CRITICAL_SECTION
- Linux下find一次查找多个指定类型文件,指定文件或者排除某类文件,在 GREP 中匹配多个关键
- java 线程(九)