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
#topInteractive command-line utility to monitor system processes in real-time
#htopInteractive 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.
#pstreeCommand to display a tree diagram of processes.
Example: pstree
#pgrepCommand to search for processes based on various criteria and print their PIDs.
Example: pgrep -u username
pgrep -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 %1
example:
#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 values from -20 to -1 are considered higher priority, with -20 being the highest priority.
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

Previous Post
Next Post

Recent posts

Quote of the week

in learning you will teach and in teaching you will learn

~ Phil Collins
Design a site like this with WordPress.com
Get started