run file bash code example Example 1: how to execute a bash script in terminal $ chmod +x fileName $ ./fileName Example 2: run sh file sh yourfile.sh