pgrep
The command that prints the process IDs of processes whose name matches a pattern.
In more detail
It saves piping ps through grep, which also matches the grep itself. Check what it finds before sending signals to those processes.
Example
pgrep sleepRelated terms
- pkill — The command that sends a signal to every process whose name matches a pattern, SIGTERM by default.
- ps — The command that lists running processes with details such as process ID, CPU use and command name.
- process ID — The number the kernel gives each running process so it can be told apart from all the others.
Taught in
- Processes, Jobs And Signals — Bash Scripting & Command Line Automation