cara menjalankan perintah saat startup di linux ubuntu atau centos

sudo nano /etc/rc.local   ## add your command 
 #!/bin/bash     ## add this in head file and your any command
 sudo chmod +x /etc/rc.local  ##for change accses file
 sudo init 6    ## for reboot 
Meto