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 的非零段位与运算后,得到的都是非零值。所以都符合查询条件。

    结束

  • 相关阅读:
    隐式马尔科夫模型
    TCP与UDP协议
    语法分析
    requests发送HTTP请求
    IPv6协议
    IP协议
    路由协议
    Django表单验证
    PDB调试Python程序
    word2vec模型原理与实现
  • 原文地址:https://www.cnblogs.com/gaojian/p/2876046.html
Copyright © 2011-2022 走看看