Making a BASH script executable (Raspberry Pi)

There were often times when I found myself typing the same commands into the terminal on my Raspberry Pi and I with my knowledge of scheduling Python (.py) files to run via CRON I decided to start running my regular terminal commands as scripts.

A BASH executable script is basically a text file saved with the file extension .sh and with a sha-bang line at the very top that reads:


With the file saved close the text editor and open a terminal window. Navigate to the folder containing the file and then type:

chmod +x

chmod +x
chmod +x

Replacing “” with the name of your BASH file’s name.

This command changes the file attributes so that it can be run as an executable. Once executable it can be run via the Terminal by typing:





2 thoughts on “Making a BASH script executable (Raspberry Pi)

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.