You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
281 B

2 years ago
  1. #!/bin/bash
  2. # Colorized pgrep
  3. arg1="$1"
  4. if [[ $arg1 = *"grep"* ]];then
  5. # remote the grep command itself from process list!
  6. ps -eo pid,ppid,uname:20,cmd | grep -v $$ | grep --color=auto "$arg1"
  7. else
  8. ps -eo pid,ppid,uname:20,cmd | grep -v 'grep' | grep --color=auto "$arg1"
  9. fi