zoukankan      html  css  js  c++  java
  • [Linux]find命令与 perm 的 + 号

    看例子:

    root@debian01:~# cd test
    root@debian01:~/test# ls
    root@debian01:~/test# touch aaa
    root@debian01:~/test# touch bbb
    root@debian01:~/test# touch ccc
    root@debian01:~/test# touch ddd
    root@debian01:~/test# chmod 6000 aaa
    root@debian01:~/test# chmod 2000 bbb
    root@debian01:~/test# chmod 4000 ccc
    root@debian01:~/test# chmod 6600 ddd
    root@debian01:~/test# find ./ -type f -perm 6000
    ./aaa
    root@debian01:~/test# find ./ -type f -perm -6000
    ./ddd
    ./aaa
    root@debian01:~/test# find ./ -type f -perm +6000
    ./ccc
    ./bbb
    ./ddd
    ./aaa
    root@debian01:~/test# 

    -perm 后面不带 + 也 不带 - ,就是 完全匹配。

    -perm 后面带 -, 就是说 包含了此mode的(比它宽泛的),例如 6600 包含了 6000。

    -perm 后面带 +,就是此mode,或者被此mode包含的。

                              例如 6000,拆为二进制后变成:110 000 000 000,

                               6600 为:                             110 110 000 000,

                               4000 为:                             100 000 000 000

                               2000 为:                             010 000 000 000

                              和600 的非零段位与运算后,得到的都是非零值。所以都符合查询条件。

    结束

  • 相关阅读:
    spring boot 配置示例
    MyBatis 常用标签用法
    http请求头部常用参数
    CentOS7使用firewalld打开关闭防火墙与端口
    java8 base64
    MD5工具类
    各种远程登录工具
    MySql 常用命令
    spring-boot-mybaits 开启事务
    springboot 项目打包到 linux下无法 运行
  • 原文地址:https://www.cnblogs.com/gaojian/p/2876046.html
Copyright © 2011-2022 走看看