5

Linux常用命令-54:nohup

 2 years ago
source link: https://xugaoxiang.com/2022/06/15/linux-cmds-54-nohup/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

nohup 命令可以将程序以忽略挂起信号的方式运行起来,程序的输出信息将不会显示到终端,而是重定向到了 nohup.out文件中,通常我们叫后台运行。通过 ssh 连接到远程服务器时,经常这么做,如果直接运行的话,当你退出这个连接后,对应终端里运行的程序也就停止。

语法格式:nohup [参数]

d439b315985b81ba.png
# 在后台运行run.sh脚本
nohup ./run.sh

# 在后台运行run.sh脚本,并将程序输出重定向到文件output.txt
nohup ./run.sh > output.txt

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK