Take a look at Serial communication between two Intel Galileo Gen 2, where I think it is described the relationship among serial, serial1, TX-RX, and the Serial Monitor you need to take into account.
Finally, is there a method to boot those command line from sketch?
If you need to execute commands from a sketch, you can use the function "system()"... but I don't know if this is what you are asking for.
Thanks for your help, I read and tested my board by loop pin 0 and 1. they worked normally. So the thing get problem here is my sensor.