How to launch sketch in linux terminal - is it possible?

Hi. I'm a new owner of Arduino Leonardo. I wrote a sketch in arduino playground for simple temperature monitor. When i run serial monitor I see temperature result from my sensors but I can't find any solution how to save or have to write program so I could run it in a Linux terminal or double clicking on .bin application with gui interface. Is it possible? Or I have to use only sketch and serial monitor to use my arduino programs?

but I can't find any solution how to save

How to save what? The text shown in the Serial Monitor's output pane? Copy and paste to a text editor and save the data in the text editor.

have to write program

Probably a better option.

Is it possible?

Developing an application is possible. Whether it is possible for you is a different question.