In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article shares with you about the methods of viewing and scheduling in the process. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.
The commands for viewing the process are ps and top, and the commands for process scheduling are at, crontab, batch and kill; process, which is the address space of one or more threads and the system resources needed by these threads. Generally speaking, the Linux system will share program code and system function libraries among processes.
The commands used for viewing and scheduling the process respectively:
The commands for process viewing are ps and top.
The command for process scheduling is at,crontab,batch,kill.
Related introduction:
The commands for process viewing are ps and top.
The ps command is used to view currently running processes.
The command for process scheduling is at,crontab,batch,kill.
Kill command
When you need to interrupt a foreground process, you usually use the
< Ctrl+c >Key combination; but for a background process, it may not be solved by a key combination, so you have to turn to the kill command. This command terminates the background process. There are many reasons for terminating the background process, perhaps because the process takes up too much CPU time, or because the process is dead. In short, this happens all the time.
The kill command ends the process by sending a specified signal to the process. If no send signal is specified, the default value is the TERM signal. The TERM signal terminates all processes that cannot capture the signal. Processes that can capture the signal may need to use the kill (9) signal, which cannot be captured.
The syntax format of the kill command is simple, roughly in the following two ways:
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.
The-p specifies that the kill command only shows the pid of the process and does not actually send an end signal.
-l displays a list of signal names, which can also be found in the / usr/include/linux/signal.h file.
Use of the kill command
Sometimes it is possible to encounter situations where a process is dead or idle but cannot be killed with the kill command. At this point, you must send signal 9 to forcibly shut down the process. Of course, this "savage" method is likely to lead to errors in open files or errors such as data loss. So don't use the method of forced termination unless you have to. If you don't respond to signal 9, I'm afraid you'll have to restart the computer.
Nohup command
In theory, when we exit the Linux system, we will end all programs, including those background programs. But sometimes, for example, you are editing a long program, but when you get off work or need to exit the system first, you do not want the system to end the program that you have edited for so long, and hope that when you exit the system, the program can continue to execute. At this point, we can use the nohup command to keep the process running after the user exits.
Usually these processes are executed in the background, and the results are written to the nohup.out file in the user's own directory (you can also use output redirection to output it to a specific file).
$nohup sort sales.dat &
This command tells sort that the command ignores that the user has logged out of the system and that it should run until the process is complete. With this method, you can start a process that will run for days or even weeks, and when it runs, the user does not need to log in.
The nohup command sends all the output and error messages of a command to the nohup.out file. If you redirect the output, only the error message is placed in the nohup.out file.
Thank you for reading! On the process of viewing and scheduling methods are shared here, I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.