Can't execute downloaded bash programs


So after some apt-get update and such, I tried to install a bash program from the repo. I did sudo apt-get install cowsay, it seemed to install fine, but when I tried to execute it by typing “cowsay” it says cowsay isn’t found. What did I do wrong?

edit: here is a picture of a example


Make sure that the path to your executable is in the $PATH variable. cowsay for instance installs to /usr/games, so you’ll want to run something similar to export PATH=$PATH:/usr/games


You’ll also need to give it execute permissions for the user who will execute the bash script. So, if it’s the logged in user, cd to the directory where cosway resides and simply type:

$ sudo chown $USER cosway

If you want to ensure it has permissions for the user, you, to execute simply type the following in immediately after the above command finishes execution:

$ sudo chmod 700 cosway

Immediately after you should be able to execute the bash script from the command line but make sure the script is from a reputable source before giving it priveleges to do anything it likes.

Good luck