Basic Concept
Processes Management
A process, in simple terms, is an instance of running program.
Whenever you issue a command in Linux, it creates or start a process.
Processes Types
When you issue a command (a process), there are two ways you can run it.
Foreground Process
Background Process
The simplest way to start a background process is to add an ampersand (&) at the end of the command.
Checking Running Processes
It is easy to see your own processes by using the ps command.
In addition, you can see more information of the processes by adding the -f option along with the ps
1 | $ps -f |
Here is the description of all the fields displayed by ps -f command −
| Column & Description | |
|---|---|
| UID | User ID that this process belongs to (the person running it) |
| PID | Process ID |
| PPID | Parent process ID (the ID of the process that started it) |
| C | CPU utilization of process |
| STIME | Process start time |
| TTY | Terminal type associated with the process |
| TIME | CPU time taken by the process |
| CMD | The command that started this process |
Kill Processes
kill the foreground processes
Just by sending a
CTRL + ckeystroke, the foreground prosses exits.kill the background processes
Firstly, you should get the PID of the background process using the
pscommand. After that, you can kill it with thekillcommand**If the process ignores the kill, you can use
kill -9followed by the PID. **
