Skip to main content
Capitalized I
Source Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 266

When I'm only interested in presence of a process, I use pgrep which doesn't show this behaviour, e.g.:

$ pgrep myprocess 1900 

In other cases (when i'mI'm interested in more info), I usually add a | grep -v grep to discard grep lines, e.g.:

$ ps -ef | grep myprocess| grep -v grep 

When I'm only interested in presence of a process, I use pgrep which doesn't show this behaviour, e.g.:

$ pgrep myprocess 1900 

In other cases (when i'm interested in more info), I usually add a | grep -v grep to discard grep lines, e.g.:

$ ps -ef | grep myprocess| grep -v grep 

When I'm only interested in presence of a process, I use pgrep which doesn't show this behaviour, e.g.:

$ pgrep myprocess 1900 

In other cases (when I'm interested in more info), I usually add a | grep -v grep to discard grep lines, e.g.:

$ ps -ef | grep myprocess| grep -v grep 

When I'm only interested in presence of a process, I use pgreppgrep which doesn't show this behaviour, e.g.:

$ pgrep myprocess 1900 

In other cases (when i'm interested in more info), I usually add a '| grep -v grep'| grep -v grep to discard grep lines, e.g.:

$ ps -ef | grep myprocess| grep -v grep 

hth.

When I'm only interested in presence of a process, I use pgrep which doesn't show this behaviour, e.g.:

$ pgrep myprocess 1900 

In other cases (when i'm interested in more info), I usually add a '| grep -v grep' to discard grep lines, e.g.:

$ ps -ef | grep myprocess| grep -v grep 

hth.

When I'm only interested in presence of a process, I use pgrep which doesn't show this behaviour, e.g.:

$ pgrep myprocess 1900 

In other cases (when i'm interested in more info), I usually add a | grep -v grep to discard grep lines, e.g.:

$ ps -ef | grep myprocess| grep -v grep 
Source Link
tonioc
  • 2.2k
  • 15
  • 12

When I'm only interested in presence of a process, I use pgrep which doesn't show this behaviour, e.g.:

$ pgrep myprocess 1900 

In other cases (when i'm interested in more info), I usually add a '| grep -v grep' to discard grep lines, e.g.:

$ ps -ef | grep myprocess| grep -v grep 

hth.