IN THIS CHAPTER
Viewing active processes with ps and top
Searching for processes with pgrep
Adjusting CPU priority with nice and renice
Moving processes to the background (bg) or foreground (fg)
Killing and signaling processes with kill and killall
Using at and batch to run commands
Scheduling commands to run repeatedly with cron
When an executable program starts up, it runs as a process that is under the management of your Linux system's process table. Linux provides all the tools you need to view and change the processes running on your system.
top commands are great for viewing information on your running processes. There are literally dozens of options to
top to help you view process information exactly the way you want to. The
pgrep command can further help find the process you want.
There are commands such as
renice for raising and lowering processor priority for a process. You can move processes to run in the background (
bg command) or back to the foreground (
Sending signals to a process is a way of changing its behavior or killing it altogether. Using the
killall commands, you can send signals to processes by PID or name, respectively. You can also send other signals to processes to do such things as reread configuration files or continue with a stopped process.
To run commands at scheduled times or so they are not tied to your shell session, you can use the
batch commands. To ...