• find命令常用场景


    1、查找/var目录下属主为root并且属组为mail的所有文件;

     find /var -user root -group mail 


    2、查找/usr目录下不属于root,bin,或student的文件;

    find /usr -not -user root -a -not -user bin -a -not -user student
    find /usr -not ( -user root -o -user bin -o -user student )


    3、查找/etc目录下最近一周内内容修改过且不属于root及student用户的文件;

    find /etc -mtime -7 -a -not ( -user root -o -user student ) -exec stat {} ;


    4、查找当前系统上没有属主或属组且最近1天内曾被访问过的文件,并将其属主属组均修改为root;

    find / (-nouser -o -nogroup ) -a -atime -1 -exec chown root.root {} ;


    5、查找/etc目录下大于1M的文件,并将其文件名写入/tmp/etc.largefiles文件中;

    find /etc -size +1M -exec echo {} >> /tmp/etc.largefiles ;


    6、查找/etc目录下所有用户都没有写权限的文件,显示出其详细信息;

    find /etc -not -perm /222 -ls
  • 相关阅读:
    与eolinker api集成
    为什么要用eolinker帮助API开发
    什么是Eolinekr
    使用Eolinker加快您的API开发
    java反射
    mybatis-查询过程
    mybatis初始化过程
    mybatis的插件分析
    web.xml中的ContextLoaderListener和DispatcherServlet区别
    css+js杂记
  • 原文地址:https://www.cnblogs.com/ElegantSmile/p/11360346.html
Copyright © 2020-2023  润新知