Created
February 21, 2014 22:59
-
-
Save bashyal/9145373 to your computer and use it in GitHub Desktop.
Grep odd/even numbers
This file contains hidden or 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
> cat search.log | awk '{ print $1 }' | grep [24680]$ | wc -l # Count even numbers | |
> cat search.log | awk '{ print $1 }' | grep [13579]$ | wc -l # Count odd numbers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment