Created
June 8, 2014 13:31
-
-
Save ykubota/a74ee5e0dd8b7c4a4991 to your computer and use it in GitHub Desktop.
ps and grep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# custom favorite ps option(s) | |
ps='ps auxww' | |
this=$0 | |
$ps | head --lines=1 | |
for i in $* | |
do | |
# set [c]mmand to avoid grep | |
command='['${i:0:1}']'${i:1} | |
$ps | grep -v $this | grep --color=auto $i | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment