Shell_Find
来源:互联网 发布:mac word选项 编辑:程序博客网 时间:2024/06/07 02:53
find
1.基本格式(绿色的部分为固定参数)
(1)find 路径 -name‘*.txt’;表示查找以.txt结尾的文件
&example: find . -name '*.txt' /*表示查找当前目录下的以.txt结尾的文件*/
(2)find 路径 -name‘[a-z]*’ ; 表示查找以字母a-z开头的文件
example: find . -name '[a-z]*'
(3) find 路径 -name ‘host*’ ; 查找以字母“host”开头的文件
(4)find 路径 -perm775 ; 查找权限是 775 的文件
(5)find 路径 -userroot ; 查找文件用户是root 的文件
(6)find 路径 -mtime +n(-n) ;查找 当前目录下n天以前(n天以内的)
(7)find 路径 -type f ; 查找当前目录下类型是file的文件(d:目录文件,l : 链接文件)
(8)find 路径 -size +1000000c ; 查找当前目录下,文件大小超过1M的文件,“-”以内的,c代表字节。
2.扩展
(1)创建多个文件,当前权限相同,修改这些用户的权限,目标权限相同
find . -perm 664 | xargs chmod 775
(2)文件批量删除同理
find . -name "test*" | xargs rm -f
1 0
- Shell_Find
- 封装的意义和喻义
- CoordinatorLayout + AppBarLayout + SwipeRefreshLayout在eclipse上使用的方法和问题记录
- js 关闭页面(Scripts may close only the windows that were opened by it.)
- 【HDU】1130 - How Many Trees?(java - BigDecimal & 卡特兰大数打表)
- 今日头条 木棒拼图
- Shell_Find
- 从OpenCV源码学习cpp_explicit
- 顺序结构演示案例
- 微信公众平台开发----自定义菜单、消息处理及获取OpenID(C#)
- xcode调试之断点调试及动态输出
- loadmorerecyclerview GitHub项目使用
- xslt入门
- 在Node.js中使用TCP套接字编程
- jquery按回车键实现表单提交代码