Skip to content

Commit

Permalink
Update nice.md (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
james-wangx committed Aug 14, 2022
1 parent 4e98340 commit 1c7e476
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions command/nice.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
nice
===

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

## 补充说明

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


### 语法

```shell
nice(选项)(参数)
nice [选项] [命令 [参数]...]
```

### 选项

```shell
-n:指定进程的优先级(整数)。
-n:指定nice值(整数,-20(最低)~19(最高))。
```

### 参数
Expand All @@ -31,10 +32,10 @@ nice(选项)(参数)
nice -19 tar zcf pack.tar.gz documents
```

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

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


0 comments on commit 1c7e476

Please sign in to comment.