리눅스 프로세스 관리하기
- 프로세스 명령어
- ps -aux
12345678whan@whan-VirtualBox:~$ ps -auxUSER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMANDroot 1 0.7 0.2 159828 9128 ? Ss 22:57 0:02 /sbin/init splaroot 2 0.0 0.0 0 0 ? S 22:57 0:00 [kthreadd]root 544 0.0 0.4 178916 17240 ? Ssl 22:57 0:00 /usr/bin/pythonroot 546 0.0 0.0 39716 3140 ? Ss 22:57 0:00 /usr/sbin/cronsyslog 547 0.0 0.1 263036 4300 ? Ssl 22:57 0:00 /usr/sbin/rsyslavahi 619 0.0 0.0 47076 340 ? S 22:57 0:00 avahi-daemon: c - top : CPU를 가장 많이 점유하는 프로세스 순으로 출력
1234567891011121314whan@whan-VirtualBox:~$ toptop - 23:03:42 up 6 min, 2 users, load average: 0.18, 0.59, 0.38Tasks: 204 total, 1 running, 171 sleeping, 0 stopped, 0 zombie%Cpu(s): 0.3 us, 0.0 sy, 0.0 ni, 99.3 id, 0.0 wa, 0.0 hi, 0.3 si, 0.0 stKiB Mem : 4039728 total, 2000696 free, 1031860 used, 1007172 buff/cacheKiB Swap: 483800 total, 483800 free, 0 used. 2731948 avail MemPID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND1532 _apt 20 0 90500 8828 7852 S 1.0 0.2 0:01.45 http2354 whan 20 0 52476 4072 3444 R 0.7 0.1 0:00.14 top32 root 20 0 0 0 0 I 0.3 0.0 0:00.16 kworker/0:183 root 20 0 0 0 0 I 0.3 0.0 0:00.09 kworker/u2:21 root 20 0 159828 9152 6768 S 0.0 0.2 0:02.04 systemd2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd - kill : 프로세스 종료
12345678whan@whan-VirtualBox:~$ ps -auxUSER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMANDroot 1 0.3 0.2 159828 9152 ? Ss 22:57 0:02 /sbin/init splaroot 2999 0.0 0.0 0 0 ? S 23:06 0:00 [jfsSync]whan 3897 4.7 1.1 827836 45584 ? Ssl 23:07 0:00 /usr/lib/gnome-whan 3933 0.6 0.1 30856 4544 pts/0 Ss+ 23:07 0:00 bashwhan 3955 0.0 0.0 48064 3664 pts/1 R+ 23:07 0:00 ps -auxwhan@whan-VirtualBox:~$ kill 3933- kill -l (L의 소문자)
- kill 3933
- kill -9 3933
- kill -1 3933 (숫자 1)
- ps -aux
- 프로세스 검색
- ps -aux | more
- ps -aux | grep bash
- ps -ef | grep bash