Timeline for bash - get pid for a script using the script filename
Current License: CC BY-SA 3.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 19, 2021 at 15:23 | comment | added | glenn jackman | To immediately kill, use pkill that takes exactly the same arguments as pgrep. | |
| Apr 10, 2021 at 17:35 | comment | added | BoomZilla | To immediately kill the found process use pgrep -f "searchterm" | xargs kill. Credits to user @cuonglm. Read his explanation here. | |
| Apr 27, 2019 at 22:26 | comment | added | Victoria Stuart | Add -l (--list-name) to pgrep to name those processes. E.g., for running script claws2postgres.sh, pgrep -l -f claws2postgres returns 23538 claws2postgres.. | |
| Oct 23, 2015 at 12:01 | comment | added | will | The result is a null (or no output). That's on gnu bash: v4.3.11(1)-release | |
| Oct 22, 2015 at 12:51 | history | answered | glenn jackman | CC BY-SA 3.0 |