search by tags

for the user

adventures into the land of the command line

grep-ing for a process whilst excluding the grep process

Easy:

[[email protected] mars]# ps -ef | grep gunicorn
root      3701  3693  0 01:33 pts/0    00:00:01 /usr/bin/python /usr/bin/gunicorn -w 1 -k eventlet -b 0.0.0.0:5000 index:app
root      3754  3701  0 01:34 pts/0    00:00:02 /usr/bin/python /usr/bin/gunicorn -w 1 -k eventlet -b 0.0.0.0:5000 index:app
root      3947  3335  0 03:09 pts/0    00:00:00 grep gunicorn

[[email protected] mars]# ps -ef | grep [g]unicorn
root      3701  3693  0 01:33 pts/0    00:00:01 /usr/bin/python /usr/bin/gunicorn -w 1 -k eventlet -b 0.0.0.0:5000 index:app
root      3754  3701  0 01:34 pts/0    00:00:02 /usr/bin/python /usr/bin/gunicorn -w 1 -k eventlet -b 0.0.0.0:5000 index:app

Note the square brackets []