Created
December 25, 2012 15:37
-
-
Save mapix/4373767 to your computer and use it in GitHub Desktop.
grep processes list avoiding the grep itself
Trick to avoid the form:
grep process | grep - v grep
This works because "[h]ttpd" matches only an "h" followed by "ttpd". The line that is printed by "ps aux" is "[h]ttpd" which includes the brackets, therefor not matching.
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
ps axu | grep [a]pache2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment