1) Save the contents of the code block into a .sh
file.
2) Then, run chmod +x what-you-called-it.sh
3) Finally, you can run it with sudo ./what-you-called-it.sh
#!/bin/bash
clear
printf "Stopping network service... "
service network-manager stop > /dev/null
echo "done"
sleep 1
printf "Bringing wlan0 down... "
sleep 1
ifconfig wlan0 down
echo "done"
sleep 1
printf "Changing MAC address... "
sleep 1
ifconfig wlan0 hw ether 00:11:22:33:44:55
echo "done"
sleep 1
printf "Bringing wlan0 up... "
sleep 1
ifconfig wlan0 up
echo "done"
sleep 1
printf "Starting network service... "
sleep 1
service network-manager start > /dev/null
echo "done"
echo