Basic knowledge of Linux: any program (suspended or absent) can be killed.

Source: Internet
Author: User
Article title: Linux basic knowledge: any program (suspended or absent) can be killed. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Foreground programs in text mode are often used This method does not work for large applications. You can use Set the current program as the background running mode (it cannot be guaranteed that it will succeed), or use Register again from another terminal to suspend the currently running program. Once you have regained control of the system, you can find the process you want to terminate.
  
For example:
  
$ Ps
  
This command is derived from Print Status, which displays the Status of all processes running by the current user. With this command, we can find the ID (PID) of the suspended process and then kill it.
  
Assume that the ID of the process to be killed is 123. the command is as follows.
  
$ Killed 123
  
Generally, users can only kill their own processes. root can kill any process. To view all processes running in the system, run the following command:
  
# Ps-axu | more
  
This command lists all currently active processes (indicated by option-a), including those that do not control the terminal (option-x ), add the user logic name (option-u) of each process to the display ). Because the display result may be more than one screen, we use the more command to display one screen at a time.
  
The kill Command also has a shortcut named killall, which can kill processes by application name. For example, the following command will kill any process named netscape.
  
$ Killall netscape
  
Although there are no control terminals connected to processes of the X Window type, you can use the xkill command (type in the X terminal) to easily kill them. This command turns the cursor into a special shape. when you move the cursor over the process to be killed and press the left mouse button, the window of the application disappears, the associated application is also aborted.
  
If your X Window system crashes and cannot be recovered. By pressing The key will easily kill X Server. After that, you 'd better use the ps aux command to find all the X Window programs that are being executed and kill them. If you do not do this, the bad program that causes X Window to crash may cause trouble again.
  
If a process is executed in the background, the system will prevent you from logging out and prompt "There are stopped jobs". if you really want to log out, you only need to log out again or enter exit, the background process is automatically aborted and you are logged out.
  
3.3.3
  

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.