我是Shell编程的新手。假设我已经从终端启动了一个程序(例如NetBeans),如果我键入
ps aux|grep netbeans
我得到了输出
pre 18775 1.2 0.0 12524 1972 pts/3 S 20:17 0:00
其中18775指定过程的PID等。
然后我用杀死它
kill 18775.
NetBeans UI将消失。如果我尝试使用第一个命令获取pid,我仍然会得到:
pre 19137 0.0 0.0 9136 1068 pts/3 S+ 20:19 0:00 grep --color=auto netbeans
如果该进程已被终止,为什么仍显示上述输出?
grep netbeans,那就是您在行尾(grep --color=auto netbeans)看到的程序