본문 바로가기

개발/서버

프로세스

옵션 컬렘 헤드 설명
%CPU %CPU 프로세스가 사용하는 CPU 점유율
%mem %MEM 프로세스가 사용하는 메모리 점유율
args COMMAND 명령어와 모든 인수를 문자열로 출력
bsdstart START 시직된 시간 : HHMM or Mon Day
bsdtime TIME 총 CPU 시간(사용자 및 시스템)
comm COMMAND 사용자 가 실행한 명령어
cp CP 10분 1 CPU 사용률
cputime TIME 총 CPU 시간 [DD-]HH:MM:SS 형식
egid EGID 이펙티브 그룹 ID 프로세스 (정수)
egroup EGROUP 이펙티브 그룹ID 프로세스(이름)
etime ELAPSED 프로세스가 실행된 소요시간 출력 [[DD-]HH:]MM:SS 형식
euid EUID 이펙티브 유저ID 프로세스(정수)
euser EUSER 이펙티브 유저 ID 프로세스(이름)
fgid FGID 파일시스템 액세스 그룹ID(정수)
fgroup FGROUP 파일시스템 액세스 그룹ID(이름)
fname COMMAND 명령어의 처음 8 문자
fuid FUID 파일시스템 액세스 유저ID(정수)
fuser FUSER 파일시스템 액세스 유저 ID(이름)
lstat STARTED 날짜 및 시간 명령을 시작
nice NI 우선순위, 19부터 0까지

pgid PGID 프로세스의 프로세스 그룹 ID
pid PID 프로세스의 프로세스 ID 넘버
ppid PPID 프로세스의 부모프로세스 ID
psr PSR 할당된 프로세스
rgid RGID 실제 그룹ID(정수)
rgroup RGROUP 실제 그룹(이름)
rss RSS 실제 메모리 사용량
rtprio RTPRIO 리얼타임 우선순위
ruid RUID 실제 유저 ID(정수)
ruser RUSER 실제 유저 (이름)
s S 수면, no interrupt 인터럽트, R:Running 실행중 , S:sleep 수면, can interrupt 인터럽트, 
T:stopped 정지 , W:paging 페이징, X:clead 죽은 , Zombie : 좀비

sess SESS 세션 지도자의 세션ID
sgi_p P 현재 실행 중인 프로세스의 프로세서
size SZ 프로세스가 사용하는 자료와 스택크기
start STARTED 프로세스가 시작된 시간 : HH:MM:SS 혹은 Month Day
start_time START 프로세스가 시작된 시간 : HH:MM:SS 혹은 MonthDay
stat STAT 실행되고 있는 프로세스 상태 
sz SZ 프로세스의 이미지 크기 (물리적 페이지)
tname TTY tty(터미널) 제어
user USER 이펙티브 유저ID 프로세스(이름)
vsize VSZ 프로세스 가상 메모리 (1024 바이트)

몇 가지 예를 듭니다.

gildang@gildang ~ $ ps -eo ppid,user,%mem,size,vsize,comm --sort=size -> 정렬
 PPID USER     %MEM  SIZE    VSZ COMMAND
    0 root      0.0     0      0 kthreadd
    2 root      0.0     0      0 ksoftirqd/0
    2 root      0.0     0      0 migration/0
    2 root      0.0     0      0 watchdog/0
    2 root      0.0     0      0 migration/1
    2 root      0.0     0      0 ksoftirqd/1
    2 root      0.0     0      0 watchdog/1
    2 root      0.0     0      0 events/0
    2 root      0.0     0      0 events/1
    2 root      0.0     0      0 cpuset
    2 root      0.0     0      0 khelper
    2 root      0.0     0      0 netns
    2 root      0.0     0      0 async/mgr

gildang@gildang ~ $ ps -eo ppid,user,bsdstart,bsdtime,%cpu,args--sort=_%CPU -> 사용자 CPU 정렬
 PPID USER      START   TIME %CPUppid,user,bsdstart,bsdtime,COMMAND        pu,args--sort=_%CPUPU
    0 root      08:46   0:00  0.0ppid,user,bsdstart,bsdtime,init           pu,args--sort=_ 0.0PU
    0 root      08:46   0:00  0.0ppid,user,bsdstart,bsdtime,kthreadd       pu,args--sort=_ 0.0PU
    2 root      08:46   0:00  0.0ppid,user,bsdstart,bsdtime,ksoftirqd/0    pu,args--sort=_ 0.0PU
    2 root      08:46   0:02  0.0ppid,user,bsdstart,bsdtime,migration/0    pu,args--sort=_ 0.0PU
    2 root      08:46   0:00  0.0ppid,user,bsdstart,bsdtime,watchdog/0     pu,args--sort=_ 0.0PU
    2 root      08:46   0:00  0.0ppid,user,bsdstart,bsdtime,migration/1    pu,args--sort=_ 0.0PU
    2 root      08:46   0:00  0.0ppid,user,bsdstart,bsdtime,ksoftirqd/1    pu,args--sort=_ 0.0PU
    2 root      08:46   0:00  0.0ppid,user,bsdstart,bsdtime,watchdog/1     pu,args--sort=_ 0.0PU
    2 root      08:46   0:00  0.0ppid,user,bsdstart,bsdtime,events/0       pu,args--sort=_ 0.0PU

gildang@gildang ~ $ ps -eo ppid,user,nice,cputime,args --sort=-nice -> 낮은 우선순위 정렬
 PPID USER      NI     TIME COMMAND
    2 root       5 00:00:00 [ksmd]
    1 rtkit      1 00:00:00 /usr/lib/rtkit/rtkit-daemon
    0 root       0 00:00:00 /sbin/init
    0 root       0 00:00:00 [kthreadd]
    2 root       0 00:00:00 [ksoftirqd/0]
    2 root       - 00:00:02 [migration/0]
    2 root       - 00:00:00 [watchdog/0]
    2 root       - 00:00:00 [migration/1]
    2 root       0 00:00:00 [ksoftirqd/1]
    2 root       - 00:00:00 [watchdog/1]
    2 root       0 00:00:00 [events/0]
    2 root       0 00:00:00 [events/1]
    2 root       0 00:00:00 [cpuset]

gildang@gildang ~ $ ps -eo ppid,user,stat,tname,sess,cputime,args --sort=user 유저 정
 PPID USER     STAT TTY       SESS     TIME COMMAND
    1 115      Ss   ?         3370 00:00:00 /usr/sbin/exim4 -bd -q30m
    1 avahi    S    ?          905 00:00:00 avahi-daemon: running [gildang.local]
  907 avahi    S    ?          905 00:00:00 avahi-daemon: chroot helper
    1 clamav   Ss   ?         3089 00:00:00 /usr/bin/freshclam -d --quiet
    1 daemon   Ss   ?         2936 00:00:00 atd
    1 gdm      S    ?         2070 00:00:00 /usr/bin/dbus-launch --exit-with-session
    1 gildang  Sl   ?         1212 00:00:00 /usr/bin/gnome-keyring-daemon --daemonize --login
 2265 gildang  Ssl  ?         3528 00:00:00 gnome-session
 3528 gildang  Rl   ?         3528 00:00:16 /usr/bin/ibus-daemon --xim