课程: Linux CentOS 7: Shells and Processes

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Manage processes

Manage processes

- [Instructor] It's common to send signals to processes. One of those signals would be terminate, if you wanted to end the process. If that doesn't work, we can forcibly kill a process by sending a kill signal. First, though, we need to know the process ID. We've already talked about the PS command for this, but we have a couple of other tools that are simpler. In the terminal, type in pidof, space, crond, and hit Enter. Also type in pgrep, space, crond, and hit Enter. Pgrep is more powerful and allows us to filter on a lot of items like username and command. But for the purpose of just getting a process ID, either will work fine. Once we have the process ID, we can use the kill command to send it a signal. To list all possible signal types, type in kill, space, -l, and hit enter. There are 64 different signals, but it's not common practice to use all of them. Generally, we want to send the process a non-destructive…

内容