linux - `find \( -perm -04000 -o -perm -02000 \)` 是什么意思
问题描述
我知道这个:
find . -perm -664
Search for files which have read and write permission for their owner and group,
and which other users can read.
但我无法弄清楚 and 的含义04000
,02000
也许lsattr
可以告诉我?但我也不知道。
谢谢。
解决方案
我得出的结论是,下面的两个命令都给出了相同的输出:
SUID权限搜索命令:
find / -perm -u=s -type f -ls 2>/dev/null
find / -perm -04000 -type f -ls 2>/dev/null
并且:
SGID权限搜索命令:
find / -perm -g=s -type f -ls 2>/dev/null
find / -perm -02000 -type f -ls 2>/dev/null
因此find \( -perm -04000 -o -perm -02000 \)
正在寻找 SUID 和 SGID 的权限位。此处的文档:https ://www.gnu.org/software/libc/manual/html_node/Permission-Bits.html
推荐阅读
- c++ - 如何使我的 cmake 目标用于 catch2 测试和项目运行更可扩展和更合理?
- sql - 补齐 SQL 查询中的空白
- python - Python 中的索引错误:“字符串索引超出范围”
- javascript - 在移动浏览器上使用 Cache API 的最大文件大小是多少
- ios - 动画 CIFilter CIPerspectiveCorrection
- typescript - 错误:键入“数字 | undefined' 不可分配给类型 'number | { valueOf(): 数字; }'?
- mysql - MySQL搜索精确匹配
- javascript - 如何在 Observable 笔记本上使用 svg.js
- arduino-uno - 我如何连接我的原型并将结果导出到原型?
- php - How to sum numbers which is appearing as a String?