HOME

  • ABOUT
  • PORTFOLIO
  • NEWS, TECH & ART
    • Websites
    • WordPress Plugins
    • Processing.org
    • Neural networks
    • New Media Art
  • RASPBERRY PI
  • ABOUT
  • PORTFOLIO
  • NEWS, TECH & ART
    • Websites
    • WordPress Plugins
    • Processing.org
    • Neural networks
    • New Media Art
  • RASPBERRY PI
Raspberry PI – excuting shell scripts

Raspberry PI – excuting shell scripts

  • execute, raspberry pi, script, shell

logoHow to execute a shell script on your Raspberry PI?

  • create a diretory for the script, for instance:
    sudo mkdir /home/pi/Code
  • create a shell script with nano (or another editor):
    sudo nano /home/pi/Code/updatePI.sh
  • example: the following shell script will update your RasPI:
    #!/bin/bash
    date
    echo UPDATING SYSTEM SOFTWARE – UPDATE
    sudo apt-get update
    echo UPDATING SYSTEM SOFTWARE – UPGRADE
    sudo apt-get upgrade
    echo UPDATING SYSTEM SOFTWARE – DISTRIBUTION
    sudo apt-get dist-upgrade
    echo REMOVING APPLICATION ORPHANS
    sudo apt-get autoremove –purge
    echo UPDATING FIRMWARE
    sudo rpi-update
  • make your script executable:
    sudo chmod +x /home/pi/Code/updatePI.sh
  • execute your script:
    sudo /home/pi/Code/updatePI.sh
  • if you are in the directory where the script is located use:
    sudo ./updatePI.sh
previous article next article
profile background
profile image

Rolf van Gelder

Owner of CAGE Web Design

CAGE was established in the year 2000

What’s new?

  • WebImageLoader – Processing Library
  • Responsive P5JS for WP – WordPress plugin
  • Optimize Database after Deleting Revisions – WordPress plugin
© 1995-2025 CAGE Web Design, Eindhoven, NL | +31 (0)6 22 66 3193