Using GREP to search for emails within a file or location

# example command:
grep -Eor "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" [File_name_or_location_to_search]

grep -Eor "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" emails

grep -Eor "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" /etc/
# grep for email within a file "emails" and the use tee to output to the terminal and a file

grep -Eor "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" emails | tee  emails-grep