To execute commands on the start-up of the Linux add the commands at the file /etc/rc.local
sudo nano /etc/rc.local
The default content of this file starts with the line:
#!/bin/sh
And ends with:
exit 0
Any commands you want to execute has to be in between these lines.
If the file does not exist, create it, and make sure it belongs to the user root and the privileges are 755:
sudo chown root: /etc/rc.local sudo chmod 755 /etc/rc.local
Certify the rc-local.service is running and is enabled to start at the boot:
sudo systemctl status rc-local.service sudo systemctl enable rc-local.service
This procedure is the same for pretty much any Debian-based Linux but if you are using another distribution different than Ubuntu 20.04 and Raspberry Pi OS double search for any particularity.