Get the App
SLTechnology News&Howtos  ›  Servers  › 

The usage of the Linux basic command renice

Shulou Source: shulou.com Published: 2022-06-01 12:40:40 12月01日 Update

This article mainly explains "the usage of the Linux basic command renice". 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 renice".

Renice

The renice instruction can re-adjust the priority of the program to run, and the priority can be modified through process id, user id, and group id. Modify the level of the group to affect all process priorities of all users in the group; modify the user level to affect all process priorities of that user. Except for superusers, other users can only change the priority of the processes they have, and can only monotonously increase their "nice value" in the range of 0 to PRIO_MAX (20). This prevents it from being above administrative regulations.) The superuser can change the priority of any process and set the priority to PRIO_MIN (- 20) ~ PRIO_MAX.

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

1. Grammar

Renice-n N-u username

Renice-n N-g gid

Renice-n N-p pid

2. List of options

Option

Description

-h |-- help

Show help documentation

-v |-- version

Show command version

-n |-- priority

Priority

-u |-- user=name

Set the priority of the specified user

-g |-- pgrp=gid

Set the priority of the group

-p |-- pid=PID

Sets the priority of the specified process

3. Examples

1) modify instruction wc priority through pid

[root@localhost ~] # ps-ao "% p%y%x%c%n" / / View process priority

PID TTY TIME COMMAND NI

8321 pts/0 00:00:00 wc 19

8451 pts/0 00:00:00 ps 0

[root@localhost ~] # renice-n 15-p 8364 / / reset the priority of the wc process to 15

8364: old priority 19, new priority 15

2) modify the priority of user root

[root@localhost ~] # renice-n 0-u root / / modify the priority of the user root is

0: old priority-11, new priority 0

[root@localhost ~] # ps-ao "% p%y%x%c%n" / / View the priority of the process. All the current processes belong to root users, and the priority is

PID TTY TIME COMMAND NI

8321 pts/0 00:00:00 wc 0

8364 pts/0 00:00:00 wc 0

8458 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 renice". After the study of this article, I believe you have a deeper understanding of the usage of the Linux basic command renice, 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: Priority user process command foundation learning content instruction level scope influence monotonous can be passed examples that is ideas situations documents articles more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Xiaomi vpn Shulou Information NVidia