# nice

改变程序执行的优先权等级

## 补充说明

**nice命令** 用于以指定的进程调度优先级启动其他的程序。

### 语法

```
nice(选项)(参数)
```

### 选项

```
-n：指定进程的优先级（整数）。
```

### 参数

指令及选项：需要运行的指令及其他选项。

### 实例

新建一个进程并设置优先级，将当前目录下的documents目录打包，但不希望tar占用太多CPU：

```
nice -19 tar zcf pack.tar.gz documents
```

方法非常简单，即在原命令前加上`nice -19`。很多人可能有疑问了，最低优先级不是19么？那是因为这个“-19”中的“-”仅表示参数前缀；所以，如果希望将当前目录下的documents目录打包，并且赋予tar进程最高的优先级：

```
nice --19 tar zcf pack.tar.gz documents
```


---

# 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/nice.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.
