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

前端 未结 9 2010
被撕碎了的回忆
被撕碎了的回忆 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.

    0 讨论(0)
  • 2020-11-27 11:34
    ssh localhost && ./command && exit
    
    0 讨论(0)
  • 2020-11-27 11:37

    What you are looking for is nohup.

    See the wiki link for how to use it.

    0 讨论(0)
提交回复
热议问题