Cut the file /etc/hosts using the delimiter ":", take the first field, remove the newline characters, and output the result to both the terminal and to a reversed version of the output.
cut -d ":" -f 1 /etc/hosts | tr -d '\n' | tee >(cat - >(rev))