run script on startup linux code example

Example 1: how to make a script run on boot linux

crontab -e
@reboot  /home/user/test.sh

Example 2: run command at startup ubuntu

Put a script containing the command in your /etc directory. Create a script such as "startup.sh" using your favorite text editor. Save the file in your /etc/init.d/ directory. Change the permissions of the script (to make it executable) by typing "chmod +x /etc/init.d/mystartup.sh"

Example 3: how to run script in linux at startup

crontab -e	// To make a crontab file
@reboot *your shell command here*	// to run at startup