Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the process scheduling of Kill command in Linux

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you how the process scheduling of Kill command in Linux is concise and easy to understand, which will definitely make your eyes shine. I hope you can gain something from the detailed introduction of this article.

Linux is a dynamic system that adapts to changing computing needs. The representation of Linux computing requirements centers around a common abstraction of processes. A process can be short-term (a command executed from the command line) or long-term (a network service). Therefore, general management of processes and their scheduling is extremely important.

1.ps Common options ps Support three options UNIX options such as-A -eBSD options such as aGNU options such as-help

1) BSD mode a foreground processes run by all users on all terminals x all processes run by the current user (including foreground processes and background daemons)ax all processes run by all users aux all processes run by all users, the user name is displayed in the result f shows the parent-child process relationship-C filters by process name k sort or-sortaxo match

o Custom output column %cpu%mempiduidgidcmdcommtty Display terminal name, such as?, Represents daemon daemon initiator of ruser command real executor of euser command state VSZ: virtual memory set, linear memory represents operating system committed memory set RSS: resident memory set actually allocated memory

2) UNIX mode-e Show all processes-f Show full format-ef Show all processes in full format-eF Show all processes in more complete format-efH Show parent-child process relationships-eo Custom display results, as follows ps -eo %cpu,%mem,pid,nice,pri,stat,comm

3) GNU way-help-sort sort

2. nice value-20 ° 19 The smaller the number, the higher the priority renice -n # (-20 ° 19) pidnice -n #(-20 ° 19) -# command View mode·ps axo ni[ce]

~]# ps axo niceNI000-20…

3. Search process pgreppgrep-u UID/USERNAME Search based on the user name of the executing program-l Add process name to the displayed results-t Terminal name-P View child process

pidof Process Name Query PID of corresponding process name, for example, search ping :

~]# pidof ping54472

The uptimeuptime command prints how long the system has been running and the average load on the system. The uptime command displays the following information: the current time, how long the system has been running, how many logged-in users are currently logged in, and the average load on the system in the past 1 minute, 5 minutes, and 15 minutes.

~]# uptime11:19:13 up 2 days, 15:12, 4 users, load average: 0.00, 0.01, 0.05

5.toptop command is a commonly used performance analysis tool under Linux. It can display the resource occupation status of each process in the system in real time and is often used for server-side performance analysis.

The kill command is used to delete programs or jobs that are in progress. Kill sends specified information to the program. The default message is SIGTERM(15), which terminates the specified program. If you still cannot terminate the program, you can use the SIGKILL(9) message to try to forcibly delete the program. The program or job number can be viewed using the ps command or job command.

1. kill Usage by PID: kill [-SIGNAL] pid …kill-n SIGNAL pid;kill-s SIGNAL pid By Name: killall [-SIGNAL] comm…By Pattern: pkill [options] pattern

2. kill common option-0 nothing, can be used to simply determine whether the process is running. -1 -HUP: Force a process to reread a configuration file-2 -INT: Abort a running process; equivalent to Ctrl+c-3 -QUIT: equivalent to ctrl+\-9 -KILL: Force kill a running process-15 -TERM: Abort a running process (default)

pkill-u username kills all processes running by the specified user-U who actually initiated the command-t processes associated with the specified terminal-l shows the process name (pgrep available)-a shows the process name in full format (pgrep available)-P shows the child processes of the specified process pkill -t pts/1 kills all processes running on the specified terminal

Linux versions are: Deepin, UbuntuKylin, Manjaro, LinuxMint, Ubuntu and other versions. Deepin is one of the best Linux distributions in China; Ubuntu Kylin is a derivative distribution based on Ubuntu;Manjaro is a Linux distribution based on Arch;LinuxMint's default Cinnamon desktop is similar to Windows XP and easy to use;Ubuntu is a Linux operating system based on desktop applications.

This is how the Kill command process scheduling works in Linux. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserves, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report