# could not get PID in a script



## erotikbaer (Nov 22, 2022)

Hi All,
In my script, I am trying to get the PID ID of the following process:

```
30679 0 SJ 0:01.47 node: homebridge (node).
```
I have tried pidof, pgrep and ps but I can't find a way to get the correct PID. 

there are multiple node processes, when i use pidof node i get more than 1 pid.

Does anyone have any idea how i can get the correct pid?

br christian


----------



## SirDice (Nov 22, 2022)

Try `pgrep -f homebridge`


----------



## erotikbaer (Nov 22, 2022)

SirDice said:


> Try `pgrep -f homebridge`


thanks a lot. thats the solution


----------

