I'm using ( sudo picocom -b 115200 /dev/ttyUSB0 ) to connect to a real-time embedded system based on ThreadX system.

Once I'm connected to this device, I use some ThreadX commands to display some logs.

Currently I'm using a manual copy past maneuver to save the logs. Is there any other way to save all the output (logs) displayed on the terminal to a file on my computer?


3 Answers 3


Using tee:

picocom /dev/ttyUSB1 -b 115200 -l | tee my.log

picocom has a logging feature -g. You can use it like;

picocom -b 115200 /dev/ttyUSB0 -g my_picocom_logfile.txt

from the manpage;

--logfile | -g
              Use specified file for logging (recording) serial input, and possibly serial output.  If the file exists, it is appended to.  Every
              character read from the serial port is written to the specified file (before input mapping is performed).  If local-echo mode is is enabled
              (see --echo option and C-c command), then every character written to the serial port (after output mapping is performed) is also logged to
              the same file.  (Default: no logging)

You can run it under script - see man script and do:

script my.log
sudo picocom -b 115200 /dev/ttyUSB0

And all the inputs and outpuits will be in my.log.

  • Great, that exactly what I need. Thank you very much !
    – YounLee
    Feb 27, 2018 at 19:40
  • @younlee Consider upvoting and accepting the answer if you found it useful.
    – bohrax
    Aug 29, 2018 at 16:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .