1sed -i "s|`cat /etc/hostname`|test|g" /etc/hosts && cat /etc/hosts 2echo test > /etc/hostname 3hostname test