-------------------------------------------------------------------------------------------------------------
1.nohup:不间断运行
无论是否将 nohup 命令的输出重定向到终端,输出都将附加到当前目录的 nohup.out 文件中。
2.&:在后台运行
两者结合: nohup command &
3.查看后台运行进程:
ps -ef|grep
ps -aux|grep
awk 提取进程ID
ps -aux|grep **|grep -v grep|awk '{print $2}'
4.查看端口:
查看使用某端口的进程:lsof -i:6800
netstat -anp|grep 6800
centOS7用 ss -anp|grep
1.nohup:不间断运行
无论是否将 nohup 命令的输出重定向到终端,输出都将附加到当前目录的 nohup.out 文件中。
如果当前目录的 nohup.out 文件不可写,输出重定向到 $HOME/nohup.out 文件中。
如果没有文件能创建或打开以用于追加,那么 Command 参数指定的命令不可调用
2.&:在后台运行
两者结合: nohup command &
3.查看后台运行进程:
ps -ef|grep
ps -aux|grep
awk 提取进程ID
ps -aux|grep **|grep -v grep|awk '{print $2}'
4.查看端口:
查看使用某端口的进程:lsof -i:6800
netstat -anp|grep 6800
centOS7用 ss -anp|grep
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30289795/viewspace-2147050/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/30289795/viewspace-2147050/