来自:http://www.pianshen.com/article/3112197129/
运行java jar:
nohup java -jar **-0.0.1-SNAPSHOT.jar &
查看进程:
- 采用top或者ps aux命令。一般 如果后台是springboot,jar包,那么command名称为java。如果前端是nodejs打包,那么就是npm。
[root@** wx]# top
top - 10:25:46 up 2 days, 11:37, 2 users, load average: 0.00, 0.01, 0.05
Tasks: 67 total, 1 running, 66 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 1016164 total, 77816 free, 250932 used, 687416 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 605480 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
17789 root 20 0 2330296 188956 13760 S 0.3 18.6 0:14.32 java
1 root 20 0 190736 3752 2512 S 0.0 0.4 0:02.57 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:00.67 ksoftirqd/0
5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
6 root 20 0 0 0 0 S 0.0 0.0 0:00.52 kworker/u2:0
7 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
9 root 20 0 0 0 0 S 0.0 0.0 0:04.79 rcu_sched
杀死进程:[root@**~]# kill -9 17789
查看控制台信息:tail -f stdout.txt
Ctrl + c 退出