Linux – run a sh file

Problem
You have a script “myscripttorun.sh” and cannot get it run as a script

Solution
Open a terminal
SU as root if higher permissions are required
Change the permissions on your script file

chmod +x /path/to/myscripttorun.sh

Run your script by simply typing, assuming you are in the directory of the script or use the entire path

./myscripttorun.sh

Tested Platform
CentOS7

Leave a Reply