/ Published in: Bash

I'm constantly checking to see if a certain program or process is running. This helps reduce the typing and the clutter.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function fps { (( $# )) && ps -aux | sed -n "1p;/___fps___/d;/$1/p" || echo "Usage: fps <search string>" } #Modified for use with multiple words in any order: function fps { typeset x y for x in $@; do y="$y/$x/!d;"; done ps -ef | sed -n "1p;/___fps___/d;${y}p" }
Comments
