I recommend looking at the arduino IDE files located at "(install path)/hardware/arduino/avr/" (on windows anyway, I should assume the same on linux).
I am unsure if the following files have the .txt extension on them, but if not use just the file name.
Open and look in "boards.txt" and find the associated entries starting with "uno." keeping this file open.
Next open "platform.txt" looking for the entries "tools.avrdude" (the avrdude part comes from boards.txt "uno.upload.tool" entry) and copy into a new text editor the value of "tools.avrdude.upload.pattern" you can fill in the parameters later.
With the command you copied replace the following:
from platform.txt
- "{cmd.path}" = "tools.avrdude.cmd.path"
- "{config.path}" = "tools.avrdude.config.path"
- "{upload.verbose}" = "tools.avrdude.upload.params.verbose"
- "{upload.verify} = "tools.avrdude.upload.verify"
now from boards.txt
- "{build.mcu}" = "uno.build.mcu"
- "{upload.protocol} = "uno.upload.protocol
- "{{serial.port}" = Your serial port (according to research something like /dev/ttyS0)
- "{upload.speed}" = "uno.upload.speed"
- "{build.path}" and "{build.project_name} = path to file you are trying to upload
So with the above set out for me to upload a program to an Arduino uno I would use something like the following in windows:
assuming install path was "C:\Arduino\"
"C:\Arduino\hardware\tools\avr\bin\avrdude.exe" "-CC:\Arduino\hardware\tools\avr\etc\avrdude.conf" -v -patmega328p -carduino "-PCOM1" -b115200 -D "-Uflash:w:C:\MyArduinoProject\build.hex:i"
for linux it could possibly be (I really am unsure):
assuming install path was "/opt/Arduino/"
"/opt/Arduino/hardware/tools/avr/bin/avrdude" "-C/opt/Arduino/hardware/tools/avr/etc/avrdude.conf" -v -patmega328p -carduino "-P/dev/ttyS0" -b115200 -D "-Uflash:w:/usr/MyArduinoProject/build.hex:i"
The above should work for you, I have previously written my own program to upload a hex file to the Arduino utilizing the above commands and avrdude.