Unless I'm missing something, there appears to be no simple way in *NIX to read from a serial port directly into a file

I had imagined something as simple as cat /dev/ttyX > file but apparently not

Does anyone know a trick that I'm missing?


If you're just trying to capture data from a serial port, Minicom might work. I believe it supports logging to a file.

I thought doing a cat /dev/ttySx would work as well...are you sure it's mapped to the proper serial port? Is something else not allowing the device file to be opened? What happens if you just cat the file instead of redirecting it?

  • Maybe it is something to do with line-buffering? – RedGrittyBrick Dec 21 '10 at 13:10
  • Strangly, This got sorted by playing with minicom... After HUP and quitting minicom, cat > file works :S Sorry for the time wasted. – Andrew Bolster Dec 21 '10 at 13:47
  • It could be that the port needed settings reset to defaults or was set in a funny mode. – Bart Silverstrim Dec 21 '10 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.