Using clojure:
(ns my.namespace
(:require [clojure.string :as str]))
(->> (str/split (slurp "/home/deadghost/fake-emails") #"\n")
(map #(second (str/split % #"@")))
set
(str/join "\n")
(spit "/home/deadghost/new-file"))
Read entire file, split by newlines into a vector, split each element by @ and take the second part of each split, convert to set to remove duplicates, join set elements with newline and spit to new file.Clear as mud?