Issues with direct g-code transmission via serial port
Mine is a wild guess, but judging from:

echo:Unknown command: "starto"
ok
echo:Unknown command: "SD init failstartuthor"
ok
echo:Unknown command: " (none, default config)50.00 Z2.50 E2rBy00.00 Y0.00 Z0.00echo"
ok
echo:Unknown command: "Unknown command"
ok
echo:Unknown command: " "starto"own comm"
ok
echo:Unknown command: "aximum XY jerk (mm/s),  Z=maximum Z jerk (mm/s),  E=maximum E jerk (mm/s)echo"
ok
echo:Unknown command: "PID settings"
ok


It looks like you may be looping back the output of your printer as an input to itself.  I am very suspicious of your line: tail -f /dev/ttyACM0 &amp; as that seems to indicate your are trying to perform other actions in the same terminal window after you started to monitor the serial connection.

If this is the case, you should definitively open the monitor in a separate terminal (tail -f /dev/ttyACM0) and feed the input in a different one (note that yo must not use the final &amp;).

Finally, you probably want to use cat &gt;&gt; /dev/ttyACM0 instead of cat &gt; /dev/ttyACM0 as you want to append your commands without truncating the existing stream.