Process Management
In the previous section, we discussed the filesystem in Linux. From a system administrator's perspective, managing processes is crucial. There will be scenarios where you'll need to start, stop, or even kill processes. Also, to avoid throttling your machine, you need to be cautious about the processes running on the system. Let's take a closer look at process management in Linux.
Processes are run by the Linux kernel, started by a user, or created by other processes. All processes are child processes of process number one, which will be covered in the next chapter. In this section, we'll learn to identify processes and how to send a signal to a process.
View Processes
If you start a program, a process ID (PID) is assigned to the process and a corresponding directory is created in /proc
.
In Bash, you can find the PID of the current shell with:
echo $$
You can also find the PID of the parent shell:
echo $PPID
To find the...