Grep and ps, exclude grep itselfBy neokrates, written on June 22, 2010 |
bash snippet |
- neokrates
- Email: uwarov@yahoo.com
- Website: http://www.thinkplexx.com
- Join date: 05-31-09
- Posts: 20
Rate it
Ad
Poll
Loading ...
Most popular search terms:
Stats
-
Since publication, this page was visited 769 time(s).
If you write a shell script, you sometimes wish to rely on the process running or not running. If you just combine grep and ps to detect that some process is running, you will always get ’some’ output.
The grep itself, if nothing else. Use -v- option to reverse criteria (show all but nothing what is ‘grep’):
ps -ef|grep firefox|grep -v grep
|
TAGS
|
|
RELATED
|
Pages
Posts
|
|
SOCIAL
|


















