When using Ubuntu, user-defined tasks can be performed by executing a script at startup and shutdown. Each of these scripts is a little particular and requires subtle modifications in order to include additional commands. This article will show you how to execute scripts upon startup, reboot, and shutdown on an Ubuntu system.
Note: Scripts are run in the alphabetical order in directories, and all scripts should be named following Linux's nomenclature rules. Only then will they run properly.
How to execute a script at startup?
- To execute a script at startup of Ubuntu, simply edit
- And add your commands.
- Note that the script must always end with
How to execute a script upon rebooting?
- To execute a script upon rebooting an Ubuntu system, you must write your script in
- Be sure to make the script executable by using
sudo chmod +x myscript
- Note that the scripts in this directory will be executed in alphabetical order. The name of your script must begin with
to run at the right time.
How to execute a script at shutdown?
- In order to execute a script at shutdown, you must put your script in
- And make it executable through
sudo chmod +x myscript
Please note that the scripts in this directory are executed in alphabetical order. Similar to the rebooting script, the name of your rebooting script must begin with
in order to run properly and at the right time.
- Ubuntu startup script
- Ubuntu run script on startup
- Ubuntu shutdown script
- Execute a script in Windows: at startup and shutdown > Guide
- How to repair a damaged filesystem in Ubuntu > Guide
- Ubuntu remove password: for sudo, for user, for root > Guide
- Xvideoservicethief ubuntu 14.04 download > Download
- How to install tar.gz in ubuntu > Guide
- How to install Flex and Bison Ubuntu
- How to boost the maximum volume in Ubuntu
- Ubuntu reset network settings: to default, command line
- Clean up configuration residue packages in Ubuntu
- Rename a partition: Ubuntu
- How to disable Ubuntu screen reader
- Ubuntu commands: list, cheat sheet, for beginners
- How to set the fastest Ubuntu download server
- How to mount a DVD in Ubuntu
- How to disable clock in menu bar
- How to install ncurses-devel on Ubuntu
- How to install Ubuntu on Windows 10: dual boot, USB, disk