常规篇:
首先,用ps查看进程,方法如下:
$ ps -ef
……
smx 1822 1 0 11:38 ? 00:00:49 gnome-terminal
smx 1827 1 4 11:38 ? 00:26:28 /usr/lib/firefox-3.6.18/firefox-bin
……
此时如果想杀了火狐的进程就在终端输入:
$ kill -s 9 1827
其中-s 9 制定了传递给进程的信号是9,即强制、尽快终止进程。
进阶篇:
改进1:
管道符“|”用来隔开两个命令,管道符左边命令的输出会作为管道符右边命令的输入。
$ ps -ef | grep firefox
smx 1827 1 4 11:38 ? 00:27:33 /usr/lib/firefox-3.6.18/firefox-bin
smx 12029 1824 0 21:54 pts/0 00:00:00 grep –color=auto firefox
这次就清爽了。然后就是
$kill -s 9 1827
改进2——使用pgrep:
pgrep的p表明了这个命令是专门用于进程查询的grep。
$ pgrep firefox
1827
看到了什么?没错火狐的PID:
$kill -s 9 1827
###socket 设置###
cd /home/soft/ebook_third
cd source/
cd eserver/
make clean
make build
cd ..
cd bin
./eserver &
exit;
netstat -tnpl|grep eserver
kill 2483
kill -9 2519