Linux command: Kill jobs nice Renice BG FG Process Management

Source: Internet
Author: User
Tags terminates

interprocess communication (Ipc:inter process communication)

Shared memory between processes

Signal: Signal

Semaphore: Send Signal

Important signals in process management:

1:sighup; Let a process not restart, you can reread its configuration file, and let the new configuration information to take effect.

2:sigint; equivalent to CTRL + C, abort a foreground process

3:sigkill; Kill a process that forces the process to terminate.

4:sigterm; safely terminate a process that can be left to the user for time, such as saving a file that is being modified before terminating

Specify a signal: kill-l View all kill signals

Signal Number: Kill-num usage:kill-15 15 for signal number

Signal Name: Kill-sigkill Usage:kill-sigint abort a foreground process

Signal name shorthand: Kill-kill usage:kill-int signal name can be abbreviated

Kill PID Terminates the process with the process number

Killall command terminates all processes that are running

Example: How to terminate a process

first through PS aux | grep process name finds PID process number for this process

To terminate the process safely through KILL-15

PS aux | grep top


[[Email protected] ~]# PS aux | grep top

Root 2428 0.2 0.0 2704 1112 pts/0 s+ 10:53 0:00 Top

[[email protected] ~]# kill-15 2428 to terminate the top process


Renice Adjusts the nice value of the process to change the priority of the process:

For non-root users, only the nice value of the process underneath will be larger and not smaller. If you want to be small, you have to have the appropriate authority.

NI values range from 20 to 19 process priority: 100 to 139

To adjust the nice value of a process that has already started:

format: Renice NI PID COMMAND  

The Renice command is to set a nice value for a process that is already running, assuming that the nice value for a running process is 3, then the nice value for the running process is 3.

Note: If a user sets a nice value that exceeds the nice's boundary value (Linux is 20 to +19), the system takes nice's boundary value as the nice value for the process.


When you specify a nice value at startup, the nice value of the command is the execution priority value

Format: Nice-n NI COMMAND usage:nice-n 3 Useadd Donggen

The nice command is to set a nice value to execute the command process, which is formatted as nice–n num command command_option, If NUM is not specified here, the default is 10. Nice-n 3 Useadd Donggen

The Renice command is to set a nice value for a process that is already running, assuming that the nice value for a running process is 3, then the nice value for the running process is 3.

Note: If a user sets a nice value that exceeds the nice's boundary value (Linux is 20 to +19), the system takes nice's boundary value as the nice value for the process.


Foreground process: takes up command prompt

Background process: After startup, release the command prompt, and subsequent operations are completed in the background.

Front desk--Backstage:

CTRL + Z: Turn the foreground job into the background

Command &: Let the commands be executed directly in the background (but at this point the process is stopped in the background)

BG: Let the process of stopping jobs in the background continue to run

Format: BG [%JOBSID] BG followed by job ID number, no job number specified, default direct execution + process


Jobs: View all jobs in the background

Job number: Different from process number

+: Command will default action for jobs

-: command to assign a second default action to the job

FG: Back-office jobs to the foreground

FG [%JOBSID]



Kill%jobsid: Terminate background process

This article is from the "Learn Linux history" blog, please be sure to keep this source http://woyaoxuelinux.blog.51cto.com/5663865/1879852

Linux command: Kill jobs nice Renice BG FG Process Management

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.