Skip to content
Bash Script Examples writing for Raspbian
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

RaspberryPi Bash Script Examples

Bash Script Examples writing for Raspbian OS

Raspberry Pi image Image: Raspberry Pi 2 Model B 1GB

Attached scripts

  • - blinking LED (On/Off GPIO)
  • - blink 7 LED one after the other
  • - LED gradual lighting up and then gradually turning off
  • - Check external server status by URL (LED blink / led Off = server is off line; LED lighting = server is online)
  • - Switch On/Off LED like as semafor
  • - Switch On/Off GPIO when you write GPIO ID



  1. Copy files from /example/ in to path home/user/ (in Raspbian OS)
  2. And open it in terminal as sudo user

Run in Raspbian OS bash terminal

  1. Open terminal (CTRL+T or CTRL+ALT+F1)
  2. Write command in terminal like this sudo ./
  3. Add GPIO ID when your script asks a question

Raspberry Pi ssh terminal window

Image: SSH Putty

  1. When answer all start up questions, script will be run

Raspbian script

Image: Raspberry Pi started bash script

End script

  • Some scripts end automaticaly but you can cancel running script by CTRL+C.

Have fun

You can’t perform that action at this time.