I assume you are asking about turning on the Arduino header Digitial pin #2 from a Linux command prompt? If that is not the case, the please ignore this post. :-)
It is not as straight forward as I would like. There are muxes for almost all of the Arduino pins. And this pin Digital pin 2 has more than one.
This diagram (from Sergey's site) has helped me get my head around it:
Sergey has put together a guide on using the Arduino pins from within the Linux command line.
Hopefully, that will answer all the questions you might have.
Digital pin 2 corresponds to gpio32 but in order to use it you need to set gpio31 to High. If this is not clear enough take a look at Sergey’s post http://www.malinov.com/Home/sergey-s-blog/intelgalileo-programminggpiofromlinux in there you’d be interested in the GPIO Pins Connection Diagram and the GPIO Pins Assignment. If you look at the table of the Pins assignment you’ll find the Arduino port number on the third column and the sysfs GPIO number in the second one. Then if you search IO2 you’ll see this pin is selected by the gpio31 when is on High. This will make more sense if you see the Pin connection diagram. I recommend you to use the diagram to be sure of which GPIOs you need to set in order to use pin. Also if you need the commands to configure the pins, they are indicated in the same post I’ve sent you. I hope you find this helpful
Thanks, I had forgotten about the link. I have is diagram actually. For most pins it's not to bad, but that one is terribly complicated.
This is the part that I had missed earlier.….
"The trapezoid shaped things are bidirectional multiplexers (or switches). They are controlled by the signal coming on the top (selector input). When the selector value is 0 it connects 0 pin on the left side of multiplexer to the pin on the right side of multiplexer; when the selector value is 1 it connects pin 1 on the left side to the pin on the right side. To give an example if you want to connect Arduino A1 pin to ADC vin1, you'll need to set gpio36 to "0"."