Linux process-related commands

Source: Internet
Author: User
Commands related to linux processes & Oslash; ps commands ◆ psaux or ps-ef list all processes in the memory ◆ find processes with names, for example, find vim: psaux | grepvim | grep-vgrep the second grep command is used to remove the g linux process-related commands in the result. Ø about the ps command ◆ ps aux or ps-ef: list all processes in the memory ◆ find one name of the process, for example, find vim: ps aux | grep vim | grep-v grep. The second grep is used to remove the grep vim process in the result (-v indicates filtering the content without matching strings) Ø process signal ◆ kill-l list system-defined signals ,:

A number indicates the serial number of a signal, and a string indicates the signal name. you can use the serial number or the signal name when transmitting a signal. ◆ Use the kill command to send signals. The syntax is as follows: kill-signal serial number PID, for example, kill-9 1234 kill-Signal name PID, for example: kill-SIGKILL 1234 or kill-KILL 1234 PID indicates the process number, so that the process receives the corresponding signal. if you want to perform special processing on the signal, you can customize it, otherwise, the default value is used. ◆ Common signal name: signal number indicates that INT2 generates the signal by pressing Ctrl-C. The TERM15kill command of the interrupt program sends the signal (that is, the kill PID) by default and terminates the program KILL9 to force the process to be deleted, generally, if the kill PID is invalid, use the kill-9 PID to force the process TSTP20 to press Ctrl-C to generate the signal and pause the process on the terminal. About background execution ◆ add the & symbol (that is, command &) at the end of the command on the terminal to run the program in the background, that is, the continued operation of the terminal is not affected. ◆ Bg [task number]: place the task in the background for execution. ◆ Fg [task number], restore the task to the foreground for execution. [Example] run the top command on the terminal. The process is always running and cannot be entered on the terminal. After pressing Ctrl-Z, the top command will be temporarily run. the output is [2] + The top process has been stopped. in this case, the top process has not actually exited, but is paused, you can run the ps aux | grep *** command to check whether the top process still exists and the status is T. Input bg and the output is [2] + top &, indicating that the process is already running in the background. Input fg or fg 2 to restore the top process to the foreground. The top command is also the real process information, but the real-time process information can be dynamically displayed when it is more powerful than PS. Other information is displayed, such as the current system time, running time, number of logged-on users, number of processes, and CPU usage statistics, memory usage statistics.

 
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.