We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87a3114 commit 6f32e1eCopy full SHA for 6f32e1e
command/getcap.md
@@ -0,0 +1,49 @@
1
+getcap
2
+===
3
+
4
+显示文件的能力(capabilities)
5
6
+## 补充说明
7
8
+**getcap命令** 用于查看文件的能力(capabilities)。在 Linux 中,文件的能力是一种权限控制机制,可以赋予普通文件特定的特权操作,而无需完全的 root 权限。
9
10
+### 语法
11
12
+```shell
13
+getcap [选项] [文件名...]
14
+```
15
16
+### 选项
17
18
19
+-v # 显示详细信息,通常与其他选项一起使用。
20
+-p # 显示进程的能力。
21
22
23
+### 参数
24
25
+文件名:指定要查看能力的文件路径。
26
27
+### 实例
28
29
+查看一个可执行文件的能力:
30
31
32
+$ getcap /usr/bin/ping
33
+/usr/bin/ping = cap_net_raw+ep
34
35
36
+查看当前目录下所有文件的能力:
37
38
39
+$ getcap *
40
41
42
43
+如果文件没有设置任何能力,getcap 不会返回任何输出。
44
45
+查看进程的能力(以 PID 为例):
46
47
48
+$ getcap -p 1234
49
0 commit comments