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