Run a command in a shell and keep running the command when you close the session

前端 未结 9 2089
被撕碎了的回忆
被撕碎了的回忆 2020-11-27 11:11

I am using Putty to connect to a remote server. What I want to know is if there is any way to write my commands and allow them to keep running after I close the session with

9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-27 11:34

    screen is the best.

    Try:

    screen -dmS "MyTail" tail -f /var/log/syslog

    This start command in background.

    Use screen -r to list, and or screen -r Mytail to enter session.

    If more users need access same session, use: screen -rx MyTail, and both or more users share the session.

提交回复
热议问题