Skip to content

Detach foreground process from terminal on Linux

将前台进程挂起到后台

<Ctrl> + Z

后台运行该程序

bg %1

将后台进程托管给init/systemd等1号进程

  • 用disown -h jobspec来使某个作业忽略HUP信号。
  • 用disown -ah 来使所有的作业都忽略HUP信号。
  • 用disown -rh 来使正在运行的作业忽略HUP信号。
disown -ah

Disclaimer
  1. License under CC BY-NC 4.0
  2. Copyright issue feedback me#imzye.me, replace # with @
  3. Not all the commands and scripts are tested in production environment, use at your own risk
  4. No privacy information is collected here
Try iOS App