In linux, view and terminate processes. In linux, terminate processes.

Source: Internet
Author: User

In linux, view and terminate processes. In linux, terminate processes.
1. Check which process occupies the port.

Example: netstat-anp | grep 1160

Ps: Check that port 1169 is occupied by that process.


2. Search for processes

Example: ps-ef | grep 'tomcat'

Ps: Find the process whose name contains tomcat


3. Terminate the process

The method for terminating a process is as follows:

Killed 8080

Ps: terminate a process with process no. 8080

If the above command cannot terminate the process, you can use the killall command to terminate the process.

For example, killall-KILL 8080

Ps: Force terminate a process with process no. 8080


How can I check the reason for linux Process Termination?

After a process is killed, it should not be running. Are you sure the process is killed? Either being suspended or using the Lun Xun mechanism to save CPU resources
 
Briefly describes how to start and terminate a linux Process and how to view the process

Processes in Linux are divided into independent daemon and passive daemon. The independent daemon is started independently, while the passive daemon is started by the Xinetd service listener. For example, the mail server configuration daemon sendmail is an independent daemon, which can be started by using the service command, and the pop3 protocol is started by a passive daemon. You need to modify/etc/xinetd. d directory, and then restart xinetd.

To view processes, run the kill command to list all background processes that have been deleted by the ps command. The syntax format of the kill command is very simple. There are roughly two methods: kill [-s Signal |-p] [-a] process number... kill-l [Signal]-s specifies the signal to be sent. It can be either a signal name or a number. -P specifies that the kill command only displays the pid of the process and does not actually send the end signal. -L display the signal name list, which can also be found in the/usr/include/linux/signal. h file. General Usage: ps lists all the current background process kill PID. If a process is suspended or idle and cannot be killed by using the kill command, a signal 9 must be sent to forcibly stop the process.

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.