Hi,
I found that sometimes the error info came with "transfer complete" but it works properly, still don't know why.
But if you want to run the sketch via your linux terminal, you can try
.sketch/sketch.elf /dev/pts/0
in your terminal. I'm still discovering this, because I found sometimes the number followed by "/dev/pts/"is different.
By the way if you switch the verbose mode of Arduino IDE you can find the temporary folder which stored the *.elf file which you can use them in linux to let the galileo behave like an arduino.
Regards