Last Updated: February 25, 2016
·
7.973K
· luke_ar

psgrep: a shortest way to do 'ps aux | grep'

Just define this alias:

alias psgrep='ps aux | grep '

And then call it with:

psgrep git

or anything you want to find!

3 Responses
Add your response

On Linux you're better of with pgrep which is less error prone and has many nifty options (like searching by user, too).

It is installed on all Linux distros I've seen so far, maybe even BSDs, but not on OS X.

over 1 year ago ·

you can brew install pgrep on OSX ;p

Also pgrep handles the grep process which always appears when grepping ps aux.

over 1 year ago ·

A version which discards grep processes and removes case sensitivity:

alias psg='ps aux | grep -v " grep " | grep -i'
over 1 year ago ·