Fast Process Search


/ Published in: Bash
Save to your folder(s)

I'm constantly checking to see if a certain program or process is running. This helps reduce the typing and the clutter.


Copy this code and paste it in your HTML
  1. function fps {
  2. (( $# )) &&
  3. ps -aux | sed -n "1p;/___fps___/d;/$1/p" ||
  4. echo "Usage: fps <search string>"
  5. }
  6.  
  7. #Modified for use with multiple words in any order:
  8.  
  9. function fps {
  10. typeset x y
  11. for x in $@; do y="$y/$x/!d;"; done
  12. ps -ef | sed -n "1p;/___fps___/d;${y}p"
  13. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.