I'm trying to capture data from a Serial Port by opening 'screen' from the terminal. It works, I see the data coming but I can't figure out how to save it to a file.

I tried to redirect the output of screen by adding > file.txt to the command line that opens screen, something like this:

screen /dev/tty.Airconsole-1 > file.txt

But it didn't work, it creates an empty file but I still see the data on the screen window.

Ideally I would like to redirect to both, I mean keep it in the window and at the same time feeding the file, probably by using the tee command.

2 Answers 2


Found possible answer at Stack Overflow:

Have you tried:

screen -L /dev/tty.Airconsole-1 > file.txt
  • No, I haven't tried the log option. I was looking to redirect the output as it comes, but will try it and will try the last answer in the link you sent me, the one with script. Thanks.
    – netbrains
    Jan 21, 2015 at 22:10
  • Tried the linked answer, the one with script and works precisely as expected. Thank you very much.
    – netbrains
    Jan 26, 2015 at 14:17

You can get screen log with interactive command "Control-a H" on screen command. It create a log file as "screenlog.n" on your user directory such as "/Users/xxxx". Please see below link: https://ss64.com/osx/screen.html

You must log in to answer this question.

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