How do I run a .sh or .command file in Terminal

Open Terminal, type in sh /path/to/file and press enter.

Faster is to type sh and a space and then drag the file to the window and release the icon anywhere on the window.


Alternatively, you could also do

cd /directory/with/executable
chmod +x executable     # only required if your file is not already executable
./executable

which will also run the executable file with its specified shell (if specified in the shebang #!/bin/(shell)