리눅스 프로세스 중단, 제거, 중지 - Kill

· 10년 전 · 1339

리눅스에서 프로세스를 죽이는 방법은 다음과 같습니다.


1. PID를 확인한다. 


 1.1 top 명령어를 통해서 PID를 확인한다.  맨 앞에 나오는 것이 PID죠.


 

[yourid@blrblrblrblrblr examples]$ top


top - 08:18:31 up 11:10,  3 users,  load average: 0.57, 0.31, 0.16

Tasks: 181 total,   1 running, 180 sleeping,   0 stopped,   0 zombie

Cpu(s):  0.6%us,  1.4%sy,  0.0%ni, 97.9%id,  0.0%wa,  0.0%hi,  0.1%si,  0.0%st

Mem:   3354856k total,  3260856k used,    94000k free,   163416k buffers

Swap:  5439484k total,        0k used,  5439484k free,  2666480k cached


  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                  

 1534 root      20   0 60132  25m 7064 S  1.0  0.8   0:14.77 Xorg                                                                                                     

18329 yourid      20   0  125m  13m  10m S  1.0  0.4   0:03.01 gnome-terminal                                                                                           

17823 yourid      20   0 25664 1816 1476 S  0.7  0.1   0:03.94 synergyc                                                                                                 

17852 yourid      20   0  110m 7384 6052 S  0.5  0.2   0:31.41 multiload-apple                                                                                          

    1 root      20   0  2888 1332 1120 S  0.0  0.0   0:01.04 init                                                                                                     

    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.29 ksoftirqd/0                                                                                              

    4 root      RT   0     0    0    0 S  0.0  0.0   0:01.36 migration/0                                                                                              

    5 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 watchdog/0                                                                                               

    6 root      RT   0     0    0    0 S  0.0  0.0   0:01.37 migration/1                                                                                              

    7 root      20   0     0    0    0 S  0.0  0.0   0:00.27 ksoftirqd/1                                                                                              

    8 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 watchdog/1                                                                                               

    9 root      20   0     0    0    0 S  0.0  0.0   0:01.33 events/0                                                                                                 

   10 root      20   0     0    0    0 S  0.0  0.0   0:00.20 events/1                                                                                                 

   11 root      20   0     0    0    0 S  0.0  0.0   0:00.00 cpuset                                                                                                   

   12 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khelper                                                                                                  

   13 root      20   0     0    0    0 S  0.0  0.0   0:00.00 netns                                                                                                    

   14 root      20   0     0    0    0 S  0.0  0.0   0:00.00 async/mgr                                                                                                

   15 root      20   0     0    0    0 S  0.0  0.0   0:00.00 pm                                                                                                       

   16 root      20   0     0    0    0 S  0.0  0.0   0:00.01 sync_supers                                                                                              

   17 root      20   0     0    0    0 S  0.0  0.0   0:00.03 bdi-default                                                                                              

   18 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kintegrityd/0                                                                                            


 


 1.2 top 말고 ps -ax로 PID를 확인한다.


 

[yourid@blrblrblrblrblr examples]$ ps -ax

Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ

  PID TTY      STAT   TIME COMMAND

     1 ?        Ss     0:01 /sbin/init

     2 ?        S      0:00 [kthreadd]

     3 ?        S      0:00 [ksoftirqd/0]

     4 ?        S      0:01 [migration/0]

     5 ?        S      0:00 [watchdog/0]

     6 ?        S      0:01 [migration/1]

     7 ?        S      0:00 [ksoftirqd/1]

     8 ?        S      0:00 [watchdog/1]

     9 ?        S      0:01 [events/0]

    10 ?        S      0:00 [events/1]

    11 ?        S      0:00 [cpuset]

    12 ?        S      0:00 [khelper]

    13 ?        S      0:00 [netns]

    14 ?        S      0:00 [async/mgr]

    15 ?        S      0:00 [pm]

    16 ?        S      0:00 [sync_supers]

    17 ?        S      0:00 [bdi-default]

18212 ?        S      0:00 /usr/libexec/gvfsd-burn --spawner :1.10 /org/gtk/gvfs/exec_spaw/1

18219 ?        S      0:00 /usr/libexec/gvfsd-metadata

18329 ?        Sl     0:03 gnome-terminal

18332 ?        S      0:00 gnome-pty-helper

18333 pts/0    Ss     0:00 bash

18593 pts/1    Ss+    0:00 bash

19309 ?        S      0:00 /usr/sbin/httpd

19396 pts/0    R+     0:00 ps -ax



2. kill -9 를 통해 프로세스를 제거한다.


Usage : kill -9 PID

|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
10년 전 조회 1,234
10년 전 조회 1,314
10년 전 조회 1,346
10년 전 조회 1,431
10년 전 조회 1,236
10년 전 조회 1,297
10년 전 조회 1,647
10년 전 조회 1,602
10년 전 조회 1,578
10년 전 조회 1,129
10년 전 조회 1,232
10년 전 조회 1,198
10년 전 조회 1,147
10년 전 조회 1,379
10년 전 조회 1,125
10년 전 조회 1,458
10년 전 조회 1,129
10년 전 조회 1,433
10년 전 조회 1,135
10년 전 조회 1,393
10년 전 조회 1,953
10년 전 조회 1,302
10년 전 조회 1,356
10년 전 조회 1,159
10년 전 조회 2,283
10년 전 조회 1,863
10년 전 조회 1,487
10년 전 조회 1,402
10년 전 조회 1,205
10년 전 조회 1,336
10년 전 조회 2,046
10년 전 조회 2,048
10년 전 조회 2,690
10년 전 조회 1,867
10년 전 조회 1,680
10년 전 조회 2,208
10년 전 조회 1,328
10년 전 조회 1,286
10년 전 조회 1,259
10년 전 조회 1,275
10년 전 조회 1,348
10년 전 조회 1,468
10년 전 조회 1,711
10년 전 조회 1,242
10년 전 조회 1,741
10년 전 조회 1,731
10년 전 조회 1,439
10년 전 조회 1,312
10년 전 조회 1,307
10년 전 조회 1,340
10년 전 조회 1,315
10년 전 조회 1,312
10년 전 조회 1,662
10년 전 조회 1,215
10년 전 조회 1,348
10년 전 조회 1,516
10년 전 조회 1,396
10년 전 조회 2,134
10년 전 조회 1,970
10년 전 조회 1,393
10년 전 조회 1,343
10년 전 조회 1,636
10년 전 조회 1,385
10년 전 조회 1,270
10년 전 조회 1,332
10년 전 조회 1,302
10년 전 조회 1,322
10년 전 조회 1,281
10년 전 조회 1,510
10년 전 조회 3,368
10년 전 조회 1,486
10년 전 조회 1,228
10년 전 조회 1,288
10년 전 조회 1,295
10년 전 조회 2,636
10년 전 조회 2,522
10년 전 조회 1,934
10년 전 조회 2,222
10년 전 조회 2,367
10년 전 조회 2,326
10년 전 조회 1,674
10년 전 조회 1,402
10년 전 조회 1,924
10년 전 조회 1,471
10년 전 조회 1,235
10년 전 조회 1,537
10년 전 조회 2,240
10년 전 조회 1,923
10년 전 조회 1,391
10년 전 조회 1,948
10년 전 조회 5,986
10년 전 조회 1,445
10년 전 조회 2,517
10년 전 조회 1,895
10년 전 조회 2,389
10년 전 조회 2,139
10년 전 조회 1,607
10년 전 조회 2,160
10년 전 조회 1,769
10년 전 조회 1,353