when I ps -af | grep rv I get lots of result even with something that has service
but I am looking for searching specific process named rv
24 Answers
You can use the command pgrep, where also the switch -w can be used:
pgrep -w "rv" The final result is the process ID of the rv process.
Just append the -w argument to grep
ps -af | grep -w rv ps -af | grep -w rv or
ps -af | grep --word-regexp rv You can use
ps -af | grep -w "rv" Alternatively, you could match the term using regex