Get the App
SLTechnology News&Howtos  ›  Servers  › 

The usage of the Linux basic command nice

Shulou Source: shulou.com Published: 2022-06-01 12:41:20 11月02日 Update

This article mainly explains "the usage of the Linux basic command nice". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the usage of the Linux basic command nice".

Nice

The nice instruction can set the priority of running the program, and the priority will affect the scheduling time of the program. The range of nice is-20 to 19, where-20 is the highest and 19 is the lowest.

The scope of this command: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

Nice [options] [cmd]

2. List of options

Option

Description

-- help

Show help documentation

-- version

Show command version

-n |-- adjustment=N

Set priority

3. Examples

1) set instruction wc priority

[root@localhost ~] # nice-n 19 wc / / sets the lowest priority for wc

^ Z / / Press the key combination ctrl+z

[2] + Stopped nice-n 19 wc

[root@localhost ~] #

2) View process priority

[root@localhost ~] # ps-ao "% p%y%x%c%n" / / View process level, wc level is 19

PID TTY TIME COMMAND NI

8321 pts/0 00:00:00 wc 19

8370 pts/0 00:00:00 ps 0

Thank you for your reading, the above is the content of "the usage of the Linux basic command nice". After the study of this article, I believe you have a deeper understanding of the usage of the Linux basic command nice, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Command priority foundation learning minimum content instruction program level scope process highest instance namely idea situation document article time Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Xiaomi MySQL Redmi Huawei