3 ms·
Yeah, I always felt having to type the extra bit was strange, like maybe grep could have a switch to say "don't find grep" but I guess having a switch for such
by smhenderson 10y ago
Yeah, I always felt having to type the extra bit was strange, like maybe grep could have a switch to say "don't find grep" but I guess having a switch for such a specific use case, grepping processes, is overkill.
Anyway, it's just a reflex now to always:
ps aux | grep <program> | grep -v grep
- amyjess 10y agoYou can also surround each character in the program's name with square brackets. ps -ef | grep [p][r][o][g][r][a][m]
- jpitz 10y agoYou only need surround one character.
- smhenderson 10y agoYes, I never knew that. But I saw it in another post and as the sibling post mentions it's enough to surround just the first character with the brackets... This is why I love HN, I learn stuff I never knew I wanted to know!