Compile and upload process from pc to arduino

I'd like to be able to upload sketches manually without the arduino IDE.

Would it be sufficient if I found these codes that the IDE uses to signal:

"clear stack memory",

"append the following set of bytes (the sketch) to stack memory" , and..

"end of code" ?

I don't understand.

The IDE uses AVRDude to upload the sketch. You can call AVRDude from the command line. Google "AVRDude command line" and there are a few good tutorials that pop up explaining how.

You may find something useful in this Thread which uses a short Python program to formulate the call to the IDE command line.