Skip to content

Instantly share code, notes, and snippets.

@kckrinke
Created November 1, 2016 22:50
Show Gist options
  • Save kckrinke/5cebbf2e194ede044bd7d8b3f112886c to your computer and use it in GitHub Desktop.
Save kckrinke/5cebbf2e194ede044bd7d8b3f112886c to your computer and use it in GitHub Desktop.
Grep the process list, without grep'ing grep itself.
#!/bin/bash
: "${PS_OPTS:=ax}"
exec ps ${PS_OPTS} | egrep -v '\b(psgrep|grep)\b' | egrep "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment