I am running the command sudo screen /dev/ttyUSB0 115200
am trying to put its output into a .txt
file.
I have already tried:
sudo screen /dev/ttyUSB0 115200 >> output.txt
sudo screen /dev/ttyUSB0 115200 > output.txt
sudo screen /dev/ttyUSB0 115200 | output.txt
But both options didn't work.
Please help.
CodePudding user response:
check the manual page for screen command
man screen
-L tells screen to turn on automatic output logging for the windows.
CodePudding user response:
if you're using screen to run the command on background, like ping www.google.com
then you just need to execute like this:
ping www.google.com >output.txt 2>&1 &