When grepping ps aux, exclude grep process from the output $ ps aux | grep "[f]nord" https://unix.stackexchange.com/a/74186 Note: you should use pgrep