Run executable file on terminal

Solution 1:

Your script should look like:

#!/bin/bash

passwd

Save it in a file, let say password.sh or simple password, then make it executable using next commands in terminal:

cd /path/to/password.sh  #or cd /path/to/password
chmod +x password.sh     #or chmod +x password

To run it from terminal, just use the following command:

./password.sh            #or ./password

or

/path/to/password.sh     #or /path/to/password

To run it only using:

password.sh              #or password

you must to add the path of the script to the PATH. See How to add a directory to the PATH? in this sense.