Several process-managed commands: Pkill,pidof,kill,killall,job

Source: Internet
Author: User
Tags terminates pkill

The Pkill command kills the process according to the process name. Pkill and Killall application methods are similar, but also directly kill the running program, if you want to kill a single process, kill it.
The Pkill command kills the process according to the process name. Pkill and Killall application methods are similar, but also directly kill the running program, if you want to kill a single process, kill it.
Grammar:

Pkill (option) (parameter)
Usage examples:

[Email protected] ~]# Pkill top

The PIDOF command is used to find the process ID number of the process with the specified name

[Email protected] ~]# pidof init1

Kill command:

Used to send signals to the process to achieve the management of the process;

Show current system available signals:

Kill-l [Signal]

There are three ways to identify each signal:

1) Digital identification of the signal;

2) The full name of the signal;

3) The abbreviated name of the signal;

Signal to process:

Kill [-S signal|-signal] pid ...

Common signals:

1) SIGHUP: No need to close the process and let it reread the configuration file;

2) SIGINT: Terminates the running process, which is equivalent to CTRL + C

9) SIGKILL: Kill the running process;

SIGTERM: Termination of the running process;

Sigcont):

SIGSTOP):


Killall command:

-Kill processes by name

Killall [-signal] Program

Linux System Job Control:


Job

Front-end operation (Foregroud): Through the terminal start, and after the start will occupy the terminal;

Background Job (Backgroud): Can be launched through the terminal, but after the boot into the background to run (release terminal);

How do I get my job running in the background?

(1) Operations in operation

CTRL + Z

Note: After sending to the backstage, the job will be switched to a stop state;

(2) Jobs that have not been started

# COMMAND &

Note: While this type of job is sent backstage, it is still relevant to the terminal, if you want to take the jobs sent back to the backend with the terminal relationship:

# Nohup COMMAND &

To view all jobs:

# jobs

Common commands to implement job control:

# FG [[%]job_num]: Bring the assigned assignment back to the foreground;

# BG [[%]job_num]: Let the job sent backstage continue to run in the background;

# Kill%job_num: Terminates the specified job;



This article from "Wang Liming" blog, declined reprint!

Several process-managed commands: Pkill,pidof,kill,killall,job

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.