chmod +x /path/to/script.sh
/path/to/script
or
./script.sh
(the above command when your are in the directory of the script file)
ls -l filename.extension
where r represents read permission. w represents write permission and x represents executable permission.
For furhter elaborations, [Click Here] (https://askubuntu.com/questions/528411/how-do-you-view-file-permissions)
echo `whoami` > /path/to/file (this will overwrite)
echo `ls` >> /path/to/file (this will append )
Make sure to add !#/bin/bash in the beginning of your bash script