Last active
May 10, 2017 10:06
-
-
Save micc83/88c011c8d363f43bc91836981d150bee to your computer and use it in GitHub Desktop.
Find email address in a given file
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
grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" file.txt | |
or even better: | |
grep -Eiorh '([[:alnum:]_.-]+@[[:alnum:]_.-]+?\.[[:alpha:].]{2,6})' "$@" * | sort | uniq > emails.txt | |
all lowercase: | |
grep -Eiorh '([[:alnum:]_.-]+@[[:alnum:]_.-]+?\.[[:alpha:].]{2,6})' "$@" * | tr "[:upper:]" "[:lower:]" | sort | uniq > emails.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment