How do I get grep to match a line that contains one thing and not another? I need to grep the output of ps to make sure that DHCPd is running, but sometimes "grep dhcpd" will show up as its own process, thus throwing off grep. For some reason the following comes to mind:
Code:
ps -aux |grep "^(grep) dhcpd"
However, the caret is functioning as an anchor, not as a logical-NOT operator. Help would be greatly appreciated.