zsh-上使用-nohup,关联 后台任务, linux, shell

在 zsh 中使用 nohup 命令 & 无效,shell退出时提示:

1
2
zsh: you have running jobs.
zsh: warning: 1 jobs SIGHUPed
  • 解决

在命令最后加感叹号,使用 nohup 命令 &!

The &! (or equivalently, &|) is a zsh-specific shortcut to both background and disown the process, such that exiting the shell will leave it running.