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

#!/bin/bash
# Colorized pgrep
arg1="$1"
if [[ $arg1 = *"grep"* ]];then
# remote the grep command itself from process list!
ps -eo pid,ppid,uname:20,cmd | grep -v $$ | grep --color=auto "$arg1"
else
ps -eo pid,ppid,uname:20,cmd | grep -v 'grep' | grep --color=auto "$arg1"
fi