If you need to trim down a list of sub-domains to only three levels of unique domains, and put the output into a new text file: cat List_Of_Domains.txt | awk -F. '{print $(NF-2)"."$(NF-1)"."$(NF)}' | sort | uniq > New_Text_File.txt Log in or register to post comments