Here is my marvelous tip for growing them yourself and recycling a bit.
Onion Recycling Tutorial

1. Take the onion you are using for cooking, green, red, yellow, or white, it doesn't matter.
Cut off the root end. You are going to do that anyway. For a bulb onion like a red, white or yellow, I kinda core the onion and cut out a little cone there at the root end.

This onion came from my garden so the roots are huge but the ones from the store work the same.
2. Take that root bit you cut off and plant it in dirt and water it well. You can directly plant this in the garden. I plant mine in a tub in my yard for easy onion access year round. You can even plant them in a flower pot in a sunny window.

There you have it. In a few weeks you will have tons of green onions for the picking. Actually I just take my knife out there and cut them off at the ground and they grow me another onion quickly. If you just need the green parts for your recipe, just snip off a few of the green things and chop them up. The onion plant will send up more and that will actually stop the plant from going to seed which makes the onion tough.

and yes I know my pot needs weeding. :o)