Skip to content

Instantly share code, notes, and snippets.

@AndrewThian
Created May 20, 2018 06:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewThian/6086c1a1adcc9587a84820e21f7bc21d to your computer and use it in GitHub Desktop.
Save AndrewThian/6086c1a1adcc9587a84820e21f7bc21d to your computer and use it in GitHub Desktop.
# find various file extensions and copy to provided directory
# https://stackoverflow.com/questions/5241625/find-and-copy-files
find / \( -name "*.html" \) -exec cp {} /<directory>;
# grep to find emails
# https://stackoverflow.com/questions/2898463/using-grep-to-find-all-emails
grep -Eiorh '([[:alnum:]_.-]+@[[:alnum:]_.-]+?\.[[:alpha:].]{2,6})' "$@" * | sort | uniq > <filename>.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment