2

Im running this command on my ubuntu 20.04

screen -S api -dm node api/index.js

But the screen session ends after 2 seconds, is there a way to see the logs of the screen session? i need to see why it is failing

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62

1 Answers1

2

If you want to see what happened on your screen then just append -L to -dm which will enable logging of the session.

screen -S api -dmL node api/index.js

Your log will be stored in the current working directory (from where you intiated this command) as screenlog.N, where N is the number of current window.

Moreover, if you want to assign different name to your logfile use-

screen -S api -dmL -Logfile log_filename node api/index.js

There is also hardcopy by the way(ESC h)

Refrence-

deepanshu
  • 625
  • 5
  • 15