$ ps aux | grep -i ssh
USER 4364 0.0 0.0 9004 1032 ? Ss 12:20 0:00 ssh -v -fND localhost:4000 USERNAME@SERVER-IP-ADDRESS
$ pgrep localhost:4000
Why doesn't this work?
|
|
|
By default,
|
|||
|
|
|
Have a look at the man page for pgrep. It is not just an alias for running ps with a bunch of columns and then greping the text output. It actually searches specific fields for values. By default, it only looks at the process name when doing a search and returns the PID. You can search the full command line by adding the |
|||
|
|