Cut the first field (separated by a colon) from the file /etc/hosts, sort the output in a unique way, and save the output to a file called tempfile1.txt.
cut -f1 -d: /etc/hosts | sort -u | tee tempfile1.txt