[root@centos7 ~]#vim hosts.txt
[root@centos7 ~]#cat hosts.txt
1 www.magedu.com
2 blog.magedu.com
3 study.magedu.com
4 linux.magedu.com
5 python.magedu.com
[root@centos7 ~]#awk -F'[ .]' '{print $2}' hosts.txt >> hosts.txt
[root@centos7 ~]#cat hosts.txt
1 www.magedu.com
2 blog.magedu.com
3 study.magedu.com
4 linux.magedu.com
5 python.magedu.com
www
blog
study
linux
python