Process management in Linux involves monitoring, controlling, and manipulating processes running on the system. Here are some common commands and techniques used for process management:
| #ps | to display information about active processes. Examples: # ps: Display a snapshot of currently running processes.# ps aux: Display a detailed list of all processes with additional info |
| #top | Interactive command-line utility to monitor system processes in real-time |
| #htop | Interactive process viewer similar to top but with a more user-friendly interface |
| #kill | #kill PID: Send a default signal to terminate the process with the specified PID. # kill -9 PID: Forcefully terminate the process with the specified PID. |
| #pstree | Command to display a tree diagram of processes. Example: pstree |
| #pgrep | Command to search for processes based on various criteria and print their PIDs. Example: pgrep -u usernamepgrep -u root | grep 170577 |
| foreground and background process | fg: Command to bring a background process to the foreground. Example: fg %1.bg: Command to move a stopped or background process to the background. Example: bg %1example: #firefox & (it will run background) |
| #nice #renice | nice: Command to start a process with a specified niceness value. Example: nice -n 10 command.renice: Command to change the priority of an existing process. Example: renice -n 10 -p PID. |
Niceness value 0 is the default priority for processes.
Niceness values from 1 to 19 are considered lower priority, with 19 being the lowest priority.
Leave a comment