# pidof

查找指定名称的进程的进程号ID号

## 补充说明

**pidof命令** 用于查找指定名称的进程的进程号id号。

### 语法

```
pidof(选项)(参数)
```

### 选项

```
-s：仅返回一个进程号；
-c：仅显示具有相同“root”目录的进程；
-x：显示由脚本开启的进程；
-o：指定不显示的进程ID。
```

### 参数

进程名称：指定要查找的进程名称。

### 实例

```
pidof nginx
13312 5371

pidof crond
1509

pidof init
1
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hezhiqiang.gitbook.io/linux/ming-ling/pidof.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
