Skip to content

Instantly share code, notes, and snippets.

@kckrinke
Created October 24, 2016 17:47
Show Gist options
  • Save kckrinke/1f071ae9404779852a3b4e23d9e99251 to your computer and use it in GitHub Desktop.
Save kckrinke/1f071ae9404779852a3b4e23d9e99251 to your computer and use it in GitHub Desktop.
Simple script to grep the ps list without grep'ing the grep itself
#!/bin/bash
export COLUMNS=1024
exec \
ps -eo pid,user,pri,stat,pcpu,command \
| grep -v grep \
| egrep "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment