专题:“find -perm”
find . -perm
Search for files which have read and write permission for their owner, and group, but which other users can read but not write to.
Files which meet these criteria but have other permissions bits set (for example if someone can execute the file) will not be matched.
find . -perm -
Search for files which have read and write permission for their owner and group, and which other users can read, without regard to the
presence of any extra permission bits (for example the executable bit). This will match a file which has mode , for example.
find . -perm /
Search for files which are writable by somebody (their owner, or their group, or anybody else).
find . -perm /
find . -perm /u+w,g+w
find . -perm /u=w,g=w
All three of these commands do the same thing, but the first one uses the octal representation of the file mode, and the other two use
the symbolic form. These commands all search for files which are writable by either their owner or their group. The files don't have
to be writable by both the owner and group to be matched; either will do.
find . -perm -
find . -perm -g+w,u+w
Both these commands do the same thing; search for files which are writable by both their owner and their group.
find . -perm - -perm / ! -perm /
find . -perm -a+r -perm /a+w ! -perm /a+x
These two commands both search for files that are readable for everybody ( -perm - or -perm -a+r), have at least one write bit set (
-perm / or -perm /a+w) but are not executable for anybody ( ! -perm / and ! -perm /a+x respectively).
Man's examples:
f@z ~/testdir/test $ ls -lha
total 24K
drwxr-xr-x f f .0K Aug : .
drwxr-xr-x f f .0K Aug : ..
-rw------x f f Jul : a.file
-rwxr-xr-x f f Aug : b.file
-rw-r----x f f Aug : c.file
---x--x--x f f Aug : d.file
f@z ~/testdir/test $ find -perm 210
精确匹配权限=210的文件或目录
f@z ~/testdir/test $ find -perm -
.
./b.file
-:指“交集”或“与”逻辑,即搜索user至少具备写权限,并且group至少具备执行权限的文件或目录;
特别注意概念!!!
这个“-”与“小于”没有关系,另外搜索的逻辑也不是比较权限位数字的大小,而是逐一查看所有的权限位(rwx)是否符合搜索条件;
!!!:搜索条件中为0(即空权限位)的角色权限(本例中为other权限),不作为筛选条件,不参与筛选。
f@z ~/testdir/test $ find -perm /
.
./a.file
./d.file
./c.file
./b.file
/:指“并集”或“或”逻辑,即搜索user至少具备写权限,或者group至少具备执行权限的文件或目录;
这个“/”与“大于”没有关系,而是逐一查看是否存在任一对应的权限位(rwx)满足搜索条件。
f@z ~/testdir/test $ find ! -perm /
!:“取反”逻辑,与“-“搭配,意指搜索条件中标注的权限位中,若任一一位为空,即作为符合条任的结果返回。
f@z ~/testdir/test $ find ! -perm -
./a.file
./d.file
./c.file
!:“取反”逻辑,与“/”塔配,意指搜索条件中标注的权限位,若全部不为空,即拥有对应的权限,则返回结果。
专题:“find -perm”的更多相关文章
- JVM性能调优监控工具专题一:JVM自带性能调优工具(jps,jstack,jmap,jhat,jstat,hprof)
性能分析工具jstatjmapjhatjstack 前提概要: JDK本身提供了很多方便的JVM性能调优监控工具,除了集成式的VisualVM和jConsole外,还有jps.jsta ...
- JVM专题2: JVM内存结构
合集目录 JVM专题2: JVM内存结构 Java 内存分配 JVM 内存结构 The JVM is an abstract computing machine that enables a comp ...
- 2016年中国微信小程序专题研究报告
2016年12月29日,全球领先的移动互联网第三方数据挖掘和分析机构iiMedia Research(艾媒咨询)权威首发<2016年中国微信小程序专题研究报告>. 报告显示,82.6%手机 ...
- [.NET领域驱动设计实战系列]专题二:结合领域驱动设计的面向服务架构来搭建网上书店
一.前言 在前面专题一中,我已经介绍了我写这系列文章的初衷了.由于dax.net中的DDD框架和Byteart Retail案例并没有对其形成过程做一步步分析,而是把整个DDD的实现案例展现给我们,这 ...
- 转载:《.NET 编程结构》专题汇总(C#)
<.NET 编程结构>专题汇总(C#) - M守护神 - 博客园http://www.cnblogs.com/liusuqi/p/3213597.html 前言 掌握一门技术,首要 ...
- 设计模式(Design Pattern)系列之.NET专题
最近,不是特别忙,重新翻了下设计模式,特地在此记录一下.会不定期更新本系列专题文章. 设计模式(Design pattern)是一套被反复使用.多数人知晓的.经过分类编目的.代码设计经验的总结. 使用 ...
- arcgis api for flex之专题图制作(饼状图,柱状图等)
最近公司给我一个任务,就是利用arcgis api for flex实现在地图上点(业务数据)直接显示饼状图以及柱状图的专题图制作,而不是通过点击点显示气泡窗口的形式来实现,这个公司已经实现了. 经过 ...
- supermap iclient for js 标签专题图(服务端)
<!DOCTYPE><html> <head> <meta http-equiv="Content-Type" content=" ...
- 【原】Spark学习总结-六个专题
最近从hadoop转向Spark了,学了一段时间了,准备写个专题,主要写pySpark的应用,主要计划是: 主题 内容概要 聚类(5.6) 1.几种常用的聚类算法:2.pyspark中聚类算法的应用( ...
随机推荐
- bzoj1066题解
[解题思路] 考虑拆点,把每根石柱拆成两个点,具体可以理解为石柱底部和石柱顶部,能爬到石柱顶部的蜥蜴只有有限只,而且蜥蜴只有爬到了石柱顶部才能跳到其他石柱的底部. 这样,考虑如下建图: 将每个有蜥蜴的 ...
- Hadoop-HDFS的伪分布式和完全分布式集群搭建
Hadoop-HDFSHDFS伪分布式集群搭建步骤一.配置免密登录 ssh-keygen -t rsa1一句话回车到底 ssh-copy-id -i ~/.ssh/id_rsa.pub root@no ...
- STM32嵌入式开发学习笔记(五):中断
我们过去了解了用循环实现延时,或用系统滴答计时器实现延时,但这两种方法都有一种问题:会阻塞处理器的运行.下面我们学习一种不阻塞处理器运行其他事件的功能:时钟中断. 所谓中断,就是让处理器放下手头的事情 ...
- 如何禁止C++默认成员函数
如何禁止C++默认成员函数 发表于 2016-03-02 | 分类于 C++ | 阅读次数 17 前言 前几天在一次笔试过程中被问到C++如何设计禁止调用默认构造函数,当时简单的想法是直 ...
- springBoot使用PageHelper当超过最大页数后仍然返回数据
在SpringBoot中使用PageHelper分页插件时,如果设置pagehelper.reasonable=true时,pageNum<=0 时会查询第一页, pageNum>page ...
- PHP面试 PHP基础知识 二(常量及数据类型)
常量及数据类型 PHP八种数据类型 四种标量类型 字符串(string).布尔(boolean).浮点(float/double).整型(integer) 两种复合类型 数组(array).对象(ob ...
- Codeforces 1169A Circle Metro
题目链接:codeforces.com/contest/1169/problem/A 题意:有俩个地铁,一个从 1 → 2 → …→ n → 1→ 2 →…, 一个 从 n → n-1 →…→ 1 → ...
- 拾遗:git pull 与 push 远程分支与本地分支顺序识别问题
最后放置的都是数据最终到达的仓库分支名称 对于pull来说,是拉到本地,所以本地仓库分支名称写在最后 git pull [--force] [remote repo]:[my repo] 对于push ...
- 剑指offer——61平衡二叉树
题目描述 输入一棵二叉树,判断该二叉树是否是平衡二叉树. 题解: 方法一:使用深度遍历,判断每个节点是不是平衡二叉树,这种从上至下的方法会导致底层的节点重复判断多次 方法二:使用后序遍历判断,这种 ...
- error C3867: “std::basic_string<char,std::char_traits<char>,std::allocator<char>>::c_str”: 函数调用缺少参数列表;请使用“&std::basic_string<char,std::char_traits<char>,std::allocator<char>>::c_str”创建指向成员的指针
这个问题找了很多没有找到满意的答案.仔细看了一下,是使用了c_str的问题. 我直接把使用string.c_str的地方使用char*代替即解决问题.