zoukankan      html  css  js  c++  java
  • linux find

     
     
    -atime #最近时间(天)
    -mtime #修改时间(天)
    -ctime #变化时间(天)
    -amin #最近时间(分)
    -mmin #修改时间(分)
    -cmin #变化时间(分)
    -size #文件大小
    -perm #文件权限
    -user #用户文件
    find . -type f -atime -7 -print #搜索7天内被访问的文件
    find . -type f -atime 7 -print #搜索7天前被访问的文件
    find . -type f -atime +7 -print #搜索超过7天被访问的文件
    find . -type f -size 2k #搜索等于2k的文件
    find . -type f -size +2k #搜索大于2k的文件
    find . -type f -size -2k #搜索小于2k的文件
    find . -type f -perm 644 #搜索权限为644的文件
    find . -iregex '.*(.py|.sh)$'  #忽略大小写匹配搜索,".*"表示匹配任意字符
    find . ! -name "*.txt"  #排除后缀.txt进行搜索,"!"表示排除或者取反
    find . -type f  -user username #搜索属于用户username的文件
    find . -type f -name"*.tmp" -delete #把匹配出来的文件删除
    find . -type f -user root -exec chown cs { } ;  #把搜索匹配出来的文件所属用户权限进行修改,{ }表示匹配出来的文件名,;表示以chown命令为结尾
    find . -type f  -name "*.txt" -print0 | xargs -0 rm -rf  #删除以.txt结尾的文件,-print0表示以空字符作为分隔符输出
    find . -type f -name ".txt" | xagrs -I {} mv {} ./tmp #把管道前面的内容移动到tmp文件夹里面
  • 相关阅读:
    ios面试题(二)
    ios之自定义UINavigationBar
    ios之自定义导航栏上的返回按钮
    ios之键盘的自定义
    ios之UITabelViewCell的自定义(xib实现2)
    ios之UITabelViewCell的自定义(xib实现)
    ios之UITabelViewCell的自定义(代码实现)
    ios 登录功能学习研究
    Create Table操作
    C#数据库查询和操作大全
  • 原文地址:https://www.cnblogs.com/yunweiweb/p/13593855.html
Copyright © 2011-2022 走看看