11 May 2012

kill process ใน Ubuntu


อยู่ ๆ firefox ก็ใช้ไม่ได้ ปิดก็ปิดไม่ได้ ทำยังไงดี

เปิด Terminal ขึ้นมา

พิมพ์ ps -ef | grep firefox

aiam 5715 1 0 22:00 ? 00:00:35 /usr/lib/firefox-3.0.1/firefox
aiam 7099 7078 0 23:21 pts/1 00:00:00 grep firefox

จากคำสั่งข้างบนใช้ ps เพื่อแสดงรายละเอียดของ process ที่ทำงานอยู่

grep firefox เพื่อให้แสดงแต่บรรทัดที่มีคำว่า firefox

aiam 7099 7078 0 23:21 pts/1 00:00:00 grep firefox

จากบรรทัดดังกล่าวแสดงให้เห็นว่า โปรแกรม firefox ทำงานอยู่โดยมี process ID = 7099
ใช้คำสั่ง kill -9 ProcessID เพื่อปิด process ที่มี ID = ProcessID

kill -9 7099

-------------------------------------------------------------------------

pgrep -l firefox
...............แสดงทุก process ที่มีคำว่า firefox


pkill firefox
.....................kill ทุก process ที่มีคำว่า firefox

No comments:

Post a Comment