Sometimes you need to get a file to your embedded linux system and all you have is a serial port. zmodem to the rescue. zmodem is nice because it manages the file creation and much faster and safer to use than xmodem.
First install rz and sz tools. also included in busybox.
sudo apt install -y lrzszThen using whatever terminal you like log into your embedded system. You should be able to keep the terminal open as long as you don't send any data during the transfer.
Below is commands to get the file over zmodem.    change /dev/ttyACM0 to whatever you serial port device is at.
#!/bin/bashstty -F /dev/ttyACM0 115200  #configure to the baud rate of the embedded system echo "rz" > /dev/ttyACM0  #run the rz server on the embedded systemsleep 0.5  #wait for the embedded system to start the serversz --zmodem YourFile >/dev/ttyACM0 < /dev/ttyACM0    #push your file file to the embedded system. And below is a more generic script allowing a filename to be passed in. scriptname sourceFile [opt: destination folder serialname baudrate]
example running on the host system: this will copy a file called fimware.bin to the embedded system to /tmp/firmware.bin
./xmodem_cp.sh fimware.bin /tmp/ /dev/ttyUSB0 921600#!/bin/bashDEVICEPIPE="/dev/ttyACM0"BAUDRATE="115200"if [ $4 ]thenBAUDRATE=$4fiif [ $3 ]thenDEVICEPIPE=$3fiif [ $2 ]thenecho "cd $2"  > $DEVICEPIPEfistty -F $DEVICEPIPE $BAUDRATEecho "rz" > $DEVICEPIPEsleep 0.5sz --zmodem $1 > $DEVICEPIPE < $DEVICEPIPE