Learning to do this was what taught me how to use GPIOs and jump started my electronics hobby. 

Steps:

1. Open a terminal on your Beaglebone, login as root using the su command. 

su

2. Start nano text editor by typing 

nano LED.sh

3. Type the header. The first line is important, the second is a comment. 

#!/bin/bash
# flasher (this is a comment I am just saying what the program will do you can type anything or exclude this)

4. Tell it where the LEDs are. This is Linux, everything is a file and located somewhere. 

cd /sys/devices/ocp.3/gpio-leds.8/leds

5. Make the system info flashing (heartbeat) stop. Note there are four LEDs, usr 0-3. You can navigate to each LED's folder and look around if you want.

echo none>beaglebone:green:usr0/trigger
echo none>beaglebone:green:usr1/trigger
echo none>beaglebone:green:usr2/trigger
echo none>beaglebone:green:usr3/trigger

6. Now we are going to make an endless loop because we are awful people like that. 

while true
do

echo 0 > beaglebone:green:usr0/brightness
echo 0 > beaglebone:green:usr1/brightness
echo 0 > beaglebone:green:usr2/brightness
echo 0 > beaglebone:green:usr3/brightness

sleep 1

echo 1 > beaglebone:green:usr0/brightness
echo 1 > beaglebone:green:usr1/brightness
echo 1 > beaglebone:green:usr2/brightness
echo 1 > beaglebone:green:usr3/brightness

sleep 1

done

7. Save and exit by hitting ctrl+o then ctrl+x

8. It isn't ready to run yet, first you need to make it executable with the following command:

chmod +x LED.sh

9. Run it.

./LED.sh

10. It is an infinite loop... but it has to end at some point. Hit ctrl+c to kill the process.

11. Make your Beaglebone's heartbeat again (flash lights to let you know it is doing things) 

echo heartbeat>beaglebone:green:usr0/trigger
echo heartbeat>beaglebone:green:usr1/trigger
echo heartbeat>beaglebone:green:usr2/trigger
echo heartbeat>beaglebone:green:usr3/trigger

 12. Try other things

echo timer>beaglebone:green:usr0/trigger
echo timer>beaglebone:green:usr1/trigger
echo timer>beaglebone:green:usr2/trigger
echo timer>beaglebone:green:usr3/trigger
echo 100>beaglebone:green:usr0/delay_on
echo 100>beaglebone:green:usr0/delay_off

echo 100>beaglebone:green:usr1/delay_on
echo 100>beaglebone:green:usr1/delay_off

echo 100>beaglebone:green:usr2/delay_on
echo 100>beaglebone:green:usr2/delay_off

echo 100>beaglebone:green:usr3/delay_on
echo 100>beaglebone:green:usr3/delay_off

You can control the GPIOs pretty much the same way, they are located in the GPIO folder instead of the leds folder. Now you can do anything.