ps 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-ps
핵심 정리
- 실행 중인 프로세스의 상태를 보여 줍니다.
-m을 주면 커널 스레드도 함께 보여 줍니다. 플래그가 없으면 현재 터미널의 프로세스만 보여 줍니다. - X/Open 형식(빼기 있음:
-e,-f,-l,-o)과 Berkeley 형식(빼기 없음:aux,v,ew)을 모두 받습니다. - 자주 쓰는 형태:
ps -ef(전체, 자세히),ps aux(CPU·메모리 비율),ps -fu 사용자,ps -o pid,ppid,etime,args,ps -T PID(트리),ps -emo THREAD(스레드). -o필드로 열을 고르고필드=머리말로 머리말을 바꿉니다.%p,%u,%a같은 필드 기술자도 씁니다.- 목록을 받는 플래그(
-o,-G,-g,-p,-t,-U,-u)는 항목 128개까지입니다. 화면 폭은COLUMNS가 정합니다. /usr/sysv/bin/ps는 System V판으로-j,-L,-c,-y같은 다른 플래그를 씁니다. 6.1에서 WPAR용-@가 생겼습니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1에서 WPAR용 -@, WPAR 열, 스케줄링 정책 표시 설명이 더해짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 4, 6.1 Volume 4 |
| 파일 | /usr/bin/ps, /usr/sysv/bin/ps(System V판) |
| 관련 명령어 | kill, nice, proctree, topas |
목적
프로세스의 상태를 보여 줍니다. 이 글은 AIX 표준 ps와 System V판 ps를 함께 다룹니다.
영어 원문
Shows status of processes. This document describes the standard AIX ps command as well as the System V version of the ps command.
구문
X/Open 형식:
ps [ -A ] [ -M ] [ -N ] [ -Z ] [ -a ] [ -d ] [ -e ] [ -f ] [ -k ] [ -l ] [ -F format ] [ -o Format ]
[ -c Clist ] [ -G Glist ] [ -g Glist ] [ -m ] [ -n NameList ] [ -p Plist ] [ -P ] [ -t Tlist ]
[ -U Ulist ] [ -u Ulist ] [ -T pid ] [ -L pidlist ] [ -X ] [ -@ [ WparName ] ]
Berkeley 형식:
ps [ a ] [ c ] [ e ] [ ew ] [ eww ] [ ewww ] [ g ] [ n ] [ w ] [ x ] [ l | s | u | v ] [ t tty ] [ X ] [ ProcessNumber ]
-@는 6.1 구문에만 있습니다.
설명
ps 명령은 실행 중인 프로세스의 상태를 표준 출력에 쓰고, -m 플래그를 주면 딸린 커널 스레드도 보여 줍니다. -m은 프로세스에 딸린 스레드를 줄을 더해 보여 줄 뿐이며, 스레드 관련 열을 더 보려면 -o 플래그에 THREAD 필드를 지정해야 합니다.
- 플래그가 없으면 현재 터미널의 정보를 보여 줍니다.
-f,-o,l,-l,s,u,v는 얼마나 많은 정보를 보여 줄지만 정하고, 어떤 프로세스를 보여 줄지는 정하지 않습니다.l,s,u,v는 서로 배타적입니다. -o를 쓰면 메모리나 페이징 영역을 살펴 프로세스를 만들 때의 명령 이름과 매개변수를 알아냅니다. 알아내지 못하면 커널에 저장된 명령 이름을 대괄호 안에 보여 줍니다.COLUMNS환경 변수가 시스템이 정한 화면 가로 크기보다 우선합니다.- 목록을 받는 플래그(
-o,-G,-g,-p,-t,-U,-u)는 항목 128개까지입니다. 예를 들어-u Ulist에는 사용자를 128명까지 지정할 수 있습니다. - (6.1) 출력에 WPAR 이름은 없지만, 현재 운영 환경의 워크로드 파티션 안에서 도는 프로세스의 프로젝트 ID, 사용자 ID, 그룹 ID가 나오면 앞에
+를 붙여 WPAR에 속함을 나타냅니다. WPAR마다 사용자·그룹·프로젝트 ID 정의가 전역 환경과 다를 수 있습니다.-@로 출력에 WPAR 이름을 넣을 수 있습니다.
참고: 응용 프로그램이 메모리를 풀어도 ps의 메모리 사용량은 줄어 보이지 않습니다. 풀린 메모리는 프로세스별 메모리 해제 목록으로 가고, ps는 이를 여전히 응용 프로그램에 할당된 메모리로 셉니다.
열 머리
플래그에 따라 출력 위에 열 머리가 붙습니다. 괄호 안은 그 열을 보여 주는 플래그입니다.
| 열 | 플래그 | 뜻 |
|---|---|---|
| ADDR | -l, l |
프로세스 스택의 세그먼트 번호. 커널 프로세스면 프로세스별 데이터 영역의 주소 |
| BND | -o THREAD |
커널 스레드가 묶인 논리 프로세서 번호. 프로세스는 모든 스레드가 같은 프로세서에 묶였을 때 표시 |
| C | -f, l, -l |
프로세스·스레드의 CPU 사용량. 시스템 시계가 틱할 때 실행 중이면 늘고, 스케줄러가 1초마다 2로 나눠 줄입니다. sched_other 정책에서 우선순위를 정하는 데 쓰이며, 크면 CPU 위주라 우선순위가 낮아지고 작으면 I/O 위주라 우선순위가 좋아집니다. |
| CMD | -f, -l, l |
명령 이름. -f에서는 현재 명령 이름과 인수를 알아내 보여 주고, 실패하면 대괄호 안에 명령 이름을 보여 줍니다. |
| COMMAND | s, u, v |
명령 이름. -f를 주면 전체 이름과 매개변수를 보여 줍니다. |
| DPGSZ | -Z |
데이터 페이지 크기 |
| F | -l, l |
프로세스·스레드의 플래그(16진수, 더한 값). 아래 표 |
| LIM | v |
setrlimit로 정한 메모리 소프트 한도. 정하지 않았으면 xx, 시스템 한도(무제한)면 UNLIM |
| NI | -l, l |
nice 값. sched_other 정책의 우선순위 계산에 씀 |
| PGIN | v |
메모리에 없는 페이지를 참조해 생긴 디스크 I/O 수 |
| PID | 모두 | 프로세스 ID |
| PPID | -f, l, -l |
부모 프로세스 ID |
| PRI | -l, l |
프로세스·커널 스레드의 우선순위. 숫자가 클수록 우선순위가 낮음 |
| PROJECT | -P |
프로세스에 할당된 프로젝트 이름 |
| RSS | v |
실제 메모리(상주 세트) 크기(1KB 단위) |
| S | -l, l |
프로세스·커널 스레드의 상태. 아래 표 |
| SC | -o THREAD |
일시 중지 횟수. 프로세스는 커널 스레드 값의 합 |
| SCH | -o THREAD,sched |
커널 스레드의 스케줄링 정책. sched_other, sched_fifo, sched_rr을 각각 0, 1, 2로 표시. sched를 지정할 때만 표시(6.1 문장) |
| SHMPGSZ | -Z |
공유 메모리 페이지 크기 |
| SIZE | v |
데이터 영역의 가상 크기(1KB 단위) |
| SPGSZ | -Z |
스택 페이지 크기 |
| SSIZ | s |
커널 스택 크기. 다중 스레드 프로세스는 늘 0 |
| STAT | s, u, v |
프로세스 상태: 0 없음, A 실행 중, I 중간, Z 취소됨, T 멈춤, K 사용 가능한 커널 프로세스 |
| STIME | -f, u |
시작 시각. 표시 형태는 LANG 환경 변수가 정함 |
| SUBPROJ | -P |
하위 프로젝트 ID |
| SZ | -l, l |
코어 이미지 크기(1KB 단위) |
| THCNT | -o thcount |
프로세스가 가진 커널 스레드 수 |
| TID | -o THREAD |
커널 스레드 ID |
| TIME | 모두 | 전체 실행 시간. mm:ss, 100분이 넘으면 mmmm:ss(-o time의 형식과 다름) |
| TPGSZ | -Z |
텍스트 페이지 크기 |
| TRS | v |
텍스트의 상주 세트 크기 |
| TSIZ | v |
텍스트(공유 프로그램) 이미지 크기 |
| TTY | 모두 | 제어 터미널. -는 터미널 없음, ?는 알 수 없음, 숫자는 TTY 번호(예: 2는 TTY2) |
| UID | -f, -l, l |
소유자의 사용자 ID. -f에서는 로그인 이름 |
| USER | u |
소유자의 로그인 이름 |
| WCHAN | -l |
프로세스·커널 스레드가 기다리는 이벤트. 실행 중인 스레드는 비어 있고, 프로세스는 잠든 스레드가 하나면 그 값, 아니면 * |
| WCHAN | l |
프로세스가 기다리는 이벤트(시스템 주소). 숫자 출력을 요청하지 않으면 주소를 분류하는 기호를 보여 줌 |
| WPAR | -@ |
프로세스가 도는 워크로드 파티션 이름(6.1) |
| %CPU | u, v |
시작한 뒤 CPU를 쓴 시간의 비율(CPU 시간 ÷ 경과 시간). 다중 프로세서에서는 CPU 수로 다시 나눕니다. 합이 100%를 넘을 수 있습니다. |
| %MEM | u, v |
이 프로세스가 쓰는 실제 메모리 비율. 다른 프로세스와 공유하는 프로그램 텍스트를 인스턴스마다 세므로 합이 100%를 넘을 수 있습니다. |
- (6.1) PROJECT와 USER 열은 WPAR 안의 프로세스이면 이름으로 바꾸지 않습니다.
-U·-u는-@로 특정 WPAR을 지정하지 않으면 현재 운영 환경에만 적용되며, 다른 WPAR을 지정하면 사용자 ID 목록은 숫자여야 합니다.
S 열의 값:
| 값 | 프로세스 | 커널 스레드 |
|---|---|---|
O |
없음 | 없음 |
A |
실행 중 | |
R |
실행 중 | |
S |
잠듦 | |
W |
스왑됨 | 스왑됨 |
I |
유휴(시작 대기) | |
Z |
취소됨 | 취소됨 |
T |
멈춤 | 멈춤 |
F 열의 주요 플래그(16진수, 더한 값):
| 플래그 | 값 | 뜻 |
|---|---|---|
| SLOAD | 0x00000001 | 코어 메모리에서 동작 중 |
| SNOSWAP | 0x00000002 | 스왑 아웃할 수 없음 |
| STRC | 0x00000008 | 추적되는 중 |
| SKPROC | 0x00000200 | 커널 프로세스 |
| SEXIT | 0x00010000 | 끝나는 중 |
| SLPDATA | 0x00020000 | 큰 페이지 사용 |
| SEXECED | 0x00200000 | 실행됨 |
| SEXECING | 0x01000000 | exec 실행 중 |
| SPSEARLYALLOC | 0x04000000 | 페이징 공간을 미리 할당 |
| TKTHREAD | 0x00001000 | 커널 전용 스레드 |
모든 프로세스·스레드 플래그의 정의는 /usr/include/sys/proc.h의 p_flags와 /usr/include/sys/thread.h의 t_flags에서 봅니다. 원문에는 이보다 긴 옛 플래그 표(SWTED, SORPHANPGRP 등)도 실려 있습니다(영어 원문 참고).
- 끝났지만 부모가 아직 기다리지 않은 프로세스는
<defunct>, 끝나려다 막힌 프로세스는<exiting>으로 표시합니다.
참고:
ps가 실행되는 동안에도 프로세스는 바뀔 수 있습니다. defunct 프로세스에 대해 보이는 데이터 일부는 의미가 없습니다.ps는 메모리를 살펴 프로세스를 만들 때의 파일 이름과 인수를 알아내지만, 프로세스가 이 정보를 지울 수 있어 믿을 수 없을 때가 있습니다.- (6.1)
ps는 사용자와 그룹 정보를 로컬 자원에서 찾습니다.
영어 원문
The ps command writes the status of active processes and if the -m flag is given, displays the associated kernel threads to standard output. While the -m flag displays threads associated with processes using extra lines, you must use the -o flag with the THREAD field specifier to display extra thread-related columns.
Without flags, the ps command displays information about the current terminal. The -f, -o, l, -l, s, u, and v flags only determine how much information is provided about a process; they do not determine which processes are listed. The l, s, u, and v flags are mutually exclusive.
With the -o flag, the ps command examines memory or the paging area and determines what the command name and parameters were when the process was created. If the ps command cannot find this information, the command name stored in the kernel is displayed in square brackets.
The COLUMNS environment variable overrides the system-selected, horizontal screen size.
The command-line flags that accept a list of parameters (the -o, -G, -g, -p, -t, -U, and -u flags) are limited to 128 items. For example, the -u Ulist flag can specify no more than 128 users.
For cases in which the output of the ps command does not include workload partition (WPAR) names but does include Project IDs (PROJECT), User IDs (UID or USER), or Group IDs (GID) associated with a process running within a workload partition under the current operating environment, the IDs are preceded by a plus sign (+) to indicate the association with a workload partition. Each workload partition contains its own definition of users, groups, and project IDs that may be different from the IDs defined for the global environment. The -@ option may be specified to include workload partition names in the output.
Note: The ps command does not show the decrease in the memory usage count when the application releases the memory. When the memory is released from the application, the memory is assigned to the per process memory freelist. The ps command accounts the memory that is released as the allocated memory for the application.
Depending on the flags used with the ps command, column headings are displayed above the information displayed to standard output. The headings are defined in the following list and the flags that cause these headings to be displayed are shown in parentheses :
ADDR (-l and l flags) Contains the segment number of the process stack, if normal; if a kernel process, the address of the preprocess data area.
BND (-o THREAD flag) The logical processor number of the processor to which the kernel thread is bound if any. For a process, this field is displayed if all its threads are bound to the same processor.
C (-f, l, and -l flags) CPU utilization of process or thread, incremented each time the system clock ticks and the process or thread is found to be running. The value is decayed by the scheduler by dividing it by 2 once per second. For the sched_other policy, CPU utilization is used in determining process scheduling priority. Large values indicate a CPU intensive process and result in lower process priority, whereas small values indicate an I/O intensive process and result in a more favorable priority.
CMD (-f, -l, and l flags) Contains the command name. Under the -f flag, the ps command tries to determine the current command name and arguments, both of which may be changed asynchronously by the process. These are then displayed. If this fails, the command name is written as it would appear without the -f option in square brackets.
COMMAND (s, u, and v) Contains the command name. The full command name and its parameters are displayed with the -f flag.
| Flags | Hexadecimal Value | Definition |
|---|---|---|
| SLOAD | 0x00000001 | Indicates that the process is operating in core memory. |
| SNOSWAP | 0x00000002 | Indicates that the process cannot be swapped out. |
| STRC | 0x00000008 | Indicates that the process is being traced. |
| SWTED | 0x00000010 | Indicates that the process stopped while being traced. |
| SFWTED | 0x00000020 | Indicates that the process stopped after a call to the fork subroutine, while being traced. |
| SEWTED | 0x00000040 | Indicates that the process stopped after a call to the exec subroutine, while being traced. |
| SLWTED | 0x00000080 | Indicates that the process stopped after a call to the load or unload subroutine, while being traced. |
| SFIXPRI | 0x00000100 | Indicates that the process has a fixed priority, ignoring the pcpu field descriptor. |
| SKPROC | 0x00000200 | Indicates a Kernel process. |
| SOMASK | 0x00000400 | Indicates restoration of the old mask after a signal is received. |
| SWAKEONSIG | 0x00000800 | Indicates that the signal will abort the sleep subroutine. The contents must not be equal to those of the PCATCH flag. The contents of both PCATCH and SWAKEONSIG must be greater than those of PMASK. |
| SUSER | 0x00001000 | Indicates that the process is in user mode. |
| SLKDONE | 0x00002000 | Indicates that the process has done locks. |
| STRACING | 0x00004000 | Indicates that the process is a debugging process. |
| SMPTRACE | 0x00008000 | Indicates multi-process debugging. |
| SEXIT | 0x00010000 | Indicates that the process is exiting. |
| SSEL | 0x00020000 | Indicates that the processor is selecting: wakeup/waiting danger. |
| SORPHANPGRP | 0x00040000 | Indicates an orphaned process group. |
| SNOCNTLPROC | 0x00080000 | Indicates that the session leader relinquished the controlling terminal. |
| SPPNOCLDSTOP | 0x00100000 | Indicates that the SIGHLD signal is not sent to the parent process when a child stops. |
| SEXECED | 0x00200000 | Indicates that process has been run. |
| SJOBSESS | 0x00400000 | Indicates that job control was used in the current session. |
| SJOBOFF | 0x00800000 | Indicates that the process is free from job control. |
| PSIGDELIVERY | 0x01000000 | Indicates that the process is used by the program-check handler. |
| SRMSHM | 0x02000000 | Indicates that the process removed shared memory during a call to the exit subroutine. |
| SSLOTFREE | 0x04000000 | Indicates that the process slot is free. |
| SNOMSG | 0x08000000 | Indicates that there are no more uprintf subroutine messages. |
WPAR (-@ flag) Contains the workload partition name. Under the -@ flag, the ps command displays the name of the workload partition in which the process is running. Specify the -@ flag with the wparname parameter to display the process information.
DPGSZ (Z flag) The data page size of the process. F (-l and l flags) Some of the more important F field flags (hexadecimal and additive) associated with processes and threads are listed in the following table:
| Flags | Hexadecimal Value | Definition |
|---|---|---|
| SLOAD | 0x00000001 | Indicates that the process is operating in core memory. |
| SNOSWAP | 0x00000002 | Indicates that the process cannot be swapped out. |
| STRC | 0x00000008 | Indicates that the process is being traced. |
| SKPROC | 0x00000200 | Indicates a kernel process. |
| SEXIT | 0x00010000 | Indicates that the process is exiting. |
| SLPDATA | 0x00020000 | Indicates that the process uses large pages. |
| SEXECED | 0x00200000 | Indicates that the process has been run. |
| SEXECING | 0x01000000 | Indicates that the process is execing (performing an exec). |
| SPSEARLYALLOC | 0x04000000 | Indicates that paging space for this process is allocated early. |
| TKTHREAD | 0x00001000 | Indicates that the thread is a kernel-only thread. |
Note: You can see the definitions of all process and thread flags by consulting the p_flags and t_flags fields in the /usr/include/sys/proc.h and /usr/include/sys/thread.h files respectively.
LIM (v flag) The soft limit on memory used, specified through a call to the setrlimit subroutine. If the limit has not been specified, then xx is displayed. If the limit is set to the system limit (unlimited), a value of UNLIM is displayed.
NI (-l and l flags) The nice value; used in calculating priority for the sched other policy.
PID (all flags) The process ID of the process.
PGIN (v flag) The number of disk I/Os resulting from references by the process to pages not loaded in core.
PPID (-f, l, and -l flags) The process ID of the parent process.
PRI (-l and l flags) The priority of the process or kernel thread; higher numbers mean lower priority.
PROJECT (-P flag) Project name assigned to the process. Under the current operating environment, the PROJECT and USER fields are not translated to names for processes running within a workload partition. The -U and -u flags only apply to the current operating environment, unless the -@ flag is included with a specific workload partition name. If the -@ flag is used to specify a workload partition other than the current operating environment, and the -U and -u flags are specified, the list of user IDs must be numeric.
RSS (v flag) The real-memory (resident set) size of the process (in 1 KB units).
S (-l and l flags) The state of the process or kernel thread :
For processes:
O Nonexistent
A Active
W Swapped
I Idle (waiting for startup)
Z Canceled
T Stopped
For kernel threads:
O Nonexistent
R Running
S Sleeping
W Swapped
Z Canceled
T Stopped
SC (-o THREAD flag) The suspend count of the process or kernel thread. For a process, the suspend count is defined as the sum of the kernel threads suspend counts.
SCH (-o THREAD, sched flag) The scheduling policy for a kernel thread. The policies sched_other, sched_fifo, and sched_rr are respectively displayed using: 0, 1, 2. The scheduling policies is displayed only when a sched flag is specified.
SIZE (v flag) The virtual size of the data section of the process (in 1 KB units).
SHMPGSZ (Z flag) The shared memory page size of the process.
SPGSZ (Z flag) The stack page size of the process.
SSIZ (s flag) The size of the kernel stack. This value is always 0 (zero) for a multi-threaded process.
STAT (s, u, and v flags) Contains the state of the process:
0 Nonexistent
A Active
I Intermediate
Z Canceled
T Stopped
K Available kernel process
STIME (-f and u flags) The starting time of the process. The LANG environment variables control the appearance of this field.
SUBPROJ (-P flag) Subproject Identifier assigned to the process.
SZ (-l and l flags) The size in 1 KB units of the core image of the process.
THCNT (-o thcount flag) The number of kernel threads owned by the process.
TID (-o THREAD flag) The thread ID of the kernel thread.
TIME (all flags) The total runtime for the process. The time is displayed in the format of mm:ss or mmmm:ss if the runtime reaches 100 minutes, which is different from the displayed format if you use the -o time flag.
TPGSZ (Z flag) The text page size of the process.
TRS (v flag) The size of resident-set (real memory) of text.
TSIZ (v flag) The size of text (shared-program) image.
TTY (all flags) The controlling terminal for the process:
- The process is not associated with a terminal.
? Unknown.
Number The TTY number. For example, the entry 2 indicates TTY2.
UID (-f, -l, and l flags) The user ID of the process owner. The login name is printed under the -f flag.
USER (u flag) The login name of the process owner. Under the current operating environment, the PROJECT and USER fields are not translated to names for processes running within a workload partition.
WCHAN (-l flag) The event for which the process or kernel thread is waiting or sleeping. For a kernel thread, this field is blank if the kernel thread is running. For a process, the wait channel is defined as the wait channel of the sleeping kernel thread if only one kernel thread is sleeping; otherwise a star is displayed. WCHAN (l flag) The event on which the process is waiting (an address in the system). A symbol that classifies the address is selected, unless a numerical output is requested.
%CPU (u and v flags) The percentage of time the process has used the CPU since the process started. This value is computed by dividing the time the process uses the CPU by the elapsed time of the process. In a multi-processor environment, the value is further divided by the number of available CPUs because several threads in the same process can run on different CPUs at the same time. (Because the time base over which this data is computed varies, the sum of all %CPU fields can exceed 100%.)
%MEM (u and v flags) The percentage of real memory used by this process. The %MEM value tends to exaggerate the cost of a process that is sharing program text with other processes. It does not account for times when multiple copies of a program are run and a copy of the program text is shared by all instances. The size of the text section is accounted for in every instance of the program. This means that if several copies of a program are run, the total %MEM value of all processes could exceed 100%.
A process that has exited and has a parent that has not yet waited for the process is marked <defunct>. A process that is blocked trying to exit is marked <exiting>. The ps command attempts to determine the file name and arguments given when the process was created by memory or by the swap area.
Notes:
The process can change while the ps command is running. Some data displayed for defunct processes is irrelevant.
The ps program examines the memory to retrieve the file name and arguments used when the process was created. However, a process can destroy information, making this method of retrieving file name and arguments unreliable.
The ps program searches the local resources for users and group information.
플래그
다음 플래그는 앞에 -(빼기)를 붙입니다.
| 플래그 | 설명 |
|---|---|
-A |
모든 프로세스의 정보를 씁니다. |
-a |
세션 리더와 터미널이 없는 프로세스를 뺀 모든 프로세스의 정보를 씁니다. |
-c Clist |
Clist에 나열한 워크로드 관리(WLM) 클래스에 속한 프로세스만 보여 줍니다. |
-d |
세션 리더를 뺀 모든 프로세스의 정보를 씁니다. |
-e |
커널 프로세스를 뺀 모든 프로세스의 정보를 씁니다. |
-F Format |
-o Format과 같습니다. |
-f |
전체 목록을 만듭니다. |
-G Glist |
Glist에 나열한 실효 그룹에 속한 프로세스만 보여 줍니다. |
-g Glist |
Glist에 나열한 프로세스 그룹에 속한 프로세스만 보여 줍니다. |
-k |
커널 프로세스를 나열합니다. |
-l |
긴 목록을 만듭니다. l 플래그도 참고합니다. |
-L pidlist |
pidlist(쉼표로 나눈 PID 목록)에 준 PID마다 모든 자손 프로세스를, 프로세스 표에 나오는 순서대로 나열합니다. |
-M |
모든 64비트 프로세스를 나열합니다. |
-m |
프로세스와 함께 커널 스레드를 나열합니다. 프로세스 줄 뒤에 커널 스레드마다 줄이 더해집니다. 알맞은 -o Format을 지정하지 않으면 스레드 전용 필드(bnd, scount, sched, thcount, tid)는 보이지 않습니다. |
-N |
스레드 통계를 모으지 않습니다. 프로세스의 스레드 사슬을 따라가지 않고 얻을 수 있는 통계만 보고합니다. |
-n NameList |
기본 대신 다른 시스템 이름 목록 파일을 지정합니다. 운영 체제가 정보를 커널에서 직접 받으므로 쓰지 않습니다. |
-o Format |
Format 형식으로 정보를 보여 줍니다(아래 설명). |
-p Plist |
Plist에 지정한 프로세스 번호의 프로세스만 보여 줍니다. |
-P |
프로젝트 이름, 프로젝트 출처, 하위 프로젝트 ID를 보여 줍니다. 프로세스에 스티키 비트가 켜져 있으면 프로젝트 이름 앞에 *를 붙입니다. 프로젝트 출처는 지금 읽어 들인 프로젝트 저장소(LOCAL 또는 LDAP)입니다. |
-t Tlist |
Tlist에 나열한 제어 tty에 딸린 프로세스만 보여 줍니다. |
-T pid |
지정한 pid를 뿌리로 하는 프로세스 계층을 ASCII 그림 트리로 보여 줍니다. -f, -F, -o, -l과 함께 쓸 수 있습니다. |
-u Ulist |
-U Ulist와 같습니다. |
-U Ulist |
Ulist에 지정한 사용자 ID나 로그인 이름의 프로세스만 보여 줍니다. -f를 쓰지 않으면 숫자 사용자 ID를, 쓰면 로그인 이름을 보여 줍니다. u 플래그도 참고합니다. |
-X |
사용자·그룹 이름을 앞 8자로 자르지 않고 모두 출력합니다. |
-Z |
프로세스의 페이지 크기 설정(DPGSZ 데이터, SHMPGSZ 공유 메모리, SPGSZ 스택, TPGSZ 텍스트)을 보여 줍니다. |
-@ [WparName] |
WparName 워크로드 파티션에 딸린 프로세스 정보를 보여 줍니다. WparName이 없으면 모든 WPAR의 프로세스 정보를 보여 줍니다. 어떤 프로세스를 보여 줄지는 다른 플래그로 정합니다. 6.1부터 |
목록을 받는 플래그(-c, -G, -g, -p, -t, -U)의 목록은 쉼표로 나누거나, 큰따옴표로 감싸 쉼표나 빈칸으로 나눕니다. (6.1) -U·-u는 -@를 함께 쓰지 않으면 현재 운영 환경에만 적용되고, 다른 WPAR을 지정하면 사용자 ID 목록은 숫자여야 합니다.
-o Format
Format에는 필드 지정자를 여러 개, 쉼표로 나누거나 큰따옴표로 감싸 쉼표·빈칸으로 나눠 씁니다. 필드마다 기본 머리말이 있으며, 필드=머리말로 바꿀 수 있습니다. 필드는 명령줄에 쓴 순서대로 열로 나오며, 열 폭은 적어도 머리말 길이입니다. 머리말을 비우면(-o user=) 폭은 기본 머리말 길이이고, 모든 머리말이 비면 머리말 줄을 쓰지 않습니다.
| 필드 | 뜻 | 기본 머리말 |
|---|---|---|
args |
실행 중인 명령의 전체 이름과 모든 인수(잘릴 수 있음) | COMMAND |
bnd |
프로세스·커널 스레드가 묶인 프로세서 | BND |
class |
워크로드 관리 클래스 | CLASS |
comm |
명령의 짧은 이름(인수 없음) | COMMAND |
cpu |
CPU 사용량(위 C 열과 같음) | |
dpgsz |
데이터 페이지 크기 | |
etime |
시작한 뒤 경과 시간 [[dd-]hh:]mm:ss |
ELAPSED |
group |
실효 그룹(이름, 안 되면 숫자) | GROUP |
nice |
nice 값 | NI |
pcpu |
쓸 수 있는 CPU 시간 대비 쓴 시간의 백분율 | %CPU |
pgid |
프로세스 그룹 ID | PGID |
pid |
프로세스 ID | PID |
ppid |
부모 프로세스 ID | PPID |
rgroup |
실제 그룹(이름, 안 되면 숫자) | RGROUP |
ruser |
실제 사용자(이름, 안 되면 숫자) | RUSER |
scount |
커널 스레드의 일시 중지 횟수 | SC |
sched |
커널 스레드의 스케줄링 정책 | SCH |
shmpgsz |
공유 메모리 페이지 크기 | |
spgsz |
스택 페이지 크기 | |
tag |
WLM 응용 프로그램 태그(30자까지, 없으면 -) |
TAG |
tcpu |
프로세스의 누적 CPU 시간. WLM이 active·passive 모드일 때만, 아니면 - |
TCPU |
tctime |
로그인 세션이 활성일 수 있는 전체 시간(세션 리더에만 의미) | TCTIME |
tdiskio |
누적 디스크 I/O 블록 수 | TDISKIO |
tpgsz |
텍스트 페이지 크기 | |
vmsize |
WLM 가상 메모리 한도. 머리말 VMSIZ로 프로세스의 가상 메모리를 1MB 단위로 표시 | VMSIZ |
thcount |
커널 스레드 수 | THCNT |
THREAD |
사용자 이름, pid·ppid, tid, S, C, PRI, scount, WCHAN, F, tty, bnd, comm을 함께 보여 줌. -m이 없으면 스레드는 보이지 않으며, 스케줄링 정책은 sched를 지정해야 보임 |
|
tid |
커널 스레드 ID | TID |
time |
시작한 뒤 누적 CPU 시간 [dd-]hh:mm:ss |
TIME |
tty |
제어 터미널 이름 | TT |
user |
실효 사용자(이름, 안 되면 숫자) | USER |
vsz |
가상 메모리의 프로세스 크기(KB, 10진 정수) | VSZ |
필드 기술자를 쓸 수도 있으며, 그때는 Format 전체를 큰따옴표로 감쌉니다.
| 기술자 | 필드 | 기본 머리말 |
|---|---|---|
%a |
args |
COMMAND |
%c |
comm |
COMMAND |
%t |
etime |
ELAPSED |
%D |
dpgsz |
DPGSZ |
%G |
group |
GROUP |
%n |
nice |
NI |
%C |
pcpu |
%CPU |
%r |
pgid |
PGID |
%p |
pid |
PID |
%P |
ppid |
PPID |
%g |
rgroup |
RGROUP |
%u |
ruser |
RUSER |
%S |
spgsz |
SPGSZ |
%x |
time |
TIME |
%T |
tpgsz |
TPGSZ |
%y |
tty |
TTY |
%U |
user |
USER |
%z |
vsz |
VSZ |
원문에는 이 밖에 기본 머리말과 필드 지정자의 대응 목록(예: "command", "ucomm"→COMM, "cputime"→TIME, "rssize"→RSS, "pmem"→PMEM, "wchan"→WCHAN 등)이 실려 있습니다(영어 원문 참고).
영어 원문
The following flags are preceded by a - (minus sign):
-A— Writes to standard output information about all processes.-a— Writes to standard output information about all processes, except the session leaders and processes not associated with a terminal.-cClist — Displays only information about processes assigned to the workload management classes listed in the Clist variable. The Clist variable is either a comma-separated list of class names or a list of class names enclosed in double quotation marks (" "), which is separated from one another by a comma or by one or more spaces, or both.-d— Writes information to standard output about all processes, except the session leaders.-e— Writes information to standard output about all processes, except kernel processes.-FFormat — Same as the-oFormat-f— Generates a full listing.-GGlist — Writes information to standard output only about processes that are in the effective groups listed for the Glist variable. The Glist variable is either a comma-separated list of effective group identifiers, or a list of effective group identifiers enclosed in double quotation marks (" ") and separated from one another by a comma or by one or more spaces.-gGlist — Writes information to standard output only about processes that are in the process groups listed for the Glist variable. The Glist variable is either a comma-separated list of process group identifiers or a list of process group identifiers enclosed in double quotation marks (" ") and separated from one another by a comma or by one or more spaces.-k— Lists kernel processes.-l— Generates a long listing. Also see the l flag.-Lpidlist — Generates a list of descendants of each and every pid that has been passed to it in the pidlist variable. The pidlist variable is a list of comma-separated process IDs. The list of descendants from all the given pid is printed in the order in which they appear in the process table.-M— Lists all 64 bit processes.-m— Lists kernel threads as well as processes. Output lines for processes are followed by an additional output line for each kernel thread. This flag does not display thread-specific fields (bnd, scount, sched, thcount, and tid), unless the appropriate-oFormat flag is specified.-N— Gathers no thread statistics. With this flag, ps reports those statistics that can be obtained by not traversing through the threads chain for the process.-nNameList — Specifies an alternative system name-list file in place of the default. The operating system does not use the-nflag because information is supplied directly to the kernel.-oFormat — Displays information in the format specified by the Format variable. Multiple field specifiers can be specified for the Format variable. The Format variable is either a comma-separated list of field specifiers or a list of field specifiers enclosed within a set of " " (double-quotation marks) and separated from one another by a comma or by one or more spaces, or both. Each field specifier has a default header. The default header can be overridden by appending an = (equal sign) followed by the user-defined text for the header. The fields are written in the order specified on the command-line in column format. The field widths are specified by the system to be at least as wide as the default or user-defined header text. If the header text is null (such as if-ouser= is specified), the field width is at least as wide as the default header text. If all header fields are null, no header line is written. The following field specifiers are recognized by the system: args Indicates the full command name being executed. All command-line arguments are included, though truncation may occur. The default header for this field is COMMAND. bnd Indicates to which (if any) processor a process or kernel thread is bound. The default header for this field is BND. class Indicates the workload management class assigned to the process or thread. The default header for this field is CLASS. comm Indicates the short name of the command being executed. Command-line arguments are not included. The default header for this field is COMMAND. cpu Determines process scheduling priority. CPU utilization of a process or thread, incremented each time the system clock ticks and the process or thread is found to be running. The value is decayed by the scheduler by dividing it by 2 once per second. For thesched_otherpolicy, Large values indicate a CPU intensive process and result in lower process priority whereas small values indicate an I/O intensive process and result in a more favorable priority. dpgsz Indicates the data page size of a process. etime Indicates the elapsed time since the process started. The elapsed time is displayed in the following format: [[ dd-]hh:]mm:ss where dd specifies the number of days, hh specifies the number of hours, mm specifies the number of minutes, and ss specifies the number of seconds. The default header for this field is ELAPSED. group Indicates the effective group ID of the process. The textual group ID is displayed. If the textual group ID cannot be obtained, a decimal representation is used. The default header for this field is GROUP. nice Indicates the decimal value of the process nice value. The default header for this field is NI.-oContinued — pcpu Indicates the ratio of CPU time used to CPU time available, expressed as a percentage. The default header for this field is %CPU. pgid Indicates the decimal value of the process group ID. The default header for this field is PGID. pid Indicates the decimal value of the process ID. The default header for this field is PID. ppid Indicates the decimal value of the parent process ID. The default header for this field is PPID. rgroup Indicates the real group ID of the process. The textual group ID is displayed. If the textual group ID cannot be obtained, a decimal representation is used. The default header for this field is RGROUP. ruser Indicates the real user ID of the process. The textual user ID is displayed. If the textual user ID cannot be obtained, a decimal representation is used. The default header for this field is RUSER. scount Indicates the suspend count for a kernel thread. The default header for this field is SC. sched Indicates the scheduling policy for a kernel thread. The default header for this field is SCH. shmpgsz Indicates the shared memory page size of a process. spgsz Indicates the stack page size of a process. tag Indicates the Workload Manager application tag. The default header for this field is TAG. The tag is a character string up to 30 characters long and may be truncated when displayed by ps. For processes that do not set their tag, this field displays as a-(hyphen). tcpu Total CPU time. Indicates the total accumulated CPU time for a single process. The command displays the information when WLM is running either in active or passive mode else, this field displays as a - (hyphen). The default header for this field is TCPU. tctime Total connect time. Indicates the total amount of time that a login session can be active. This is meaningful only in the case of session leader processes. The default header for this field is TCTIME. tdiskio Total disk I/O. Indicates the total accumulated blocks of disk I/O for a single process. The default header for this field is TDISKIO. tpgsz Indicates the text page size of a process. vmsize Indicates the WLM virtual memory limits. When this is used, a new header, VMSIZ is displayed. VMSIZ displays the virtual memory used by the process. This value is displayed in 1 MB units. thcount Indicates the number of kernel threads owned by the process. The default header for this field is THCNT.-oContinued — THREAD Indicates the following fields: • User name (the uname field) • Process and parent process IDs for processes (the pid and ppid fields) • Kernel thread ID for threads (the tid field) • The state of the process or kernel thread (the S field) • The CPU utilization of the process or kernel thread (the C field) • The priority of the process or kernel thread (the PRI field) • The suspend count of the process or kernel thread (the scount field) • The wait channel of the process or kernel thread (the WCHAN field) • The flags of the process or kernel thread (the F field) • The controlling terminal of the process (the tty field) • The CPU to which the process or kernel thread is bound (the bnd field) • The command being executed by the process (the comm field). Threads are not displayed with the-o THREADflag, unless the-mflag is also specified. Note: Theps -o THREADflag does not print the scheduler policies. The scheduling policies are displayed only when a sched flag is specified. tid Indicates the thread ID of a kernel thread. The default header for this field is TID. time Indicates the cumulative CPU time since the process started. The time is displayed in the following format: [ dd-] hh:mm:ss where dd specifies the number of days, hh specifies the number of hours, mm specifies the number of minutes, and ss specifies the number of seconds. The default header for this field is TIME. tty Indicates the controlling terminal name of the process. The default header for this field is TT. user Indicates the effective user ID of the process. The textual user ID is displayed. If the textual user ID cannot be obtained, a decimal representation is used. The default header for this field is USER. vsz Indicates, as a decimal integer, the size in kilobytes of the process in virtual memory. The default header for this field is VSZ. Otherwise, multiple fields in a specified format can be displayed by the Format variable, including field descriptors. If field descriptors are used in the Format variable, it must be enclosed in double quotation marks (" "). The following table shows how field descriptors correspond to field specifiers:Field Field Default Descriptors Specifiers Headers %a args COMMAND %c comm COMMAND %t etime ELAPSED %D dpgsz DPGSZ %G group GROUP %n nice NI %C pcpu %CPU %r pgid PGID %p pid PID %P ppid PPID %g rgroup RGROUP %u ruser RUSER %S spgsz SPGSZ %x time TIME %T tpgsz TPGSZ gd %y tty TTY %U user USER %z vsz VSZEach field specifier has a default header. The default header can be overridden by appending an equal sign (=) followed by the user-defined text for the header. The fields are written in the order specified on the command-line in column format. The field widths are specified by the system to be at least as wide as the default or user-defined header text. If the header text is null (for example,-o user=is specified), the field width is at least as wide as the default header text. If all header fields are null, no header line is written. Following is the mapping between the default headers and various field specifiers. Every entry in the Default Header column can be overridden by appending an equal sign (=) to the corresponding entry in the Field specifier followed by the user-defined text for the header.Default Header Field specifier ARGS "args" COMM "comm" COMM "command" COMM "ucomm" F_ETIME "etime" GROUP "group" GROUP "gname" GID "gid" NICE "nice" PRI "pri" NICE "ni" PCPU "pcpu" PMEM "pmem" PGID "pgid" PID "pid" PPID "ppid" RGROUP "rgroup" RGROUP "rgname" RGID "rgid" RUSER "ruser" RUSER "runame" RUID "ruid" TIME "time" TIME "cputime" TTY "tty" TTY "tt" TTY "tname" TTY "longtname" USER "user" USER "uname" UID "uid" LOGNAME "logname" STIME "start" VSZ "vsz" VSZ "vsize" RSS "rssize" FLAG "flag" STATUS "status" CP "cp" PAGEIN "pagein" WCHAN "wchan" NWCHAN "nwchan" ST "st" TID "tid" SCOUNT "scount" BIND "bnd" SCHED "sched" THCOUNT "thcount" TAG "tag" CLASS "class" TCPU "tcpu" TDISKIO "tdiskio" TCTIME "tctime" MACLAB "mac"-pPlist — Displays only information about processes with the process numbers specified for the Plist variable. The Plist variable is either a comma-separated list of process ID numbers or a list of process ID numbers enclosed in double quotation marks (" ") and separated from one another by a comma or by one or more spaces, or both.-P— Displays the Project name, Project origin, and subproject identifier for the project. If the stick bit is set for the process, the project name is preceded by an asterisk (*) character. The Project origin field designates the currently loaded project repository (LOCAL or LDAP).-tTlist — Displays only information about processes associated with the controlling ttys listed in the Tlist variable. The Tlist variable is either a comma-separated list of tty identifiers or a list of tty identifiers enclosed in double quotation marks (" ") and separated from one another by a comma or by one or more spaces, or both.-Tpid — Displays the process hierarchy rooted at a given pid in a tree format using ASCII art. This flag can be used in combination with the-f,-F,-o, and-lflags.-uUlist — This flag is equivalent to the-UUlist flag. The-uflag only applies to the current operating environment unless the-@flag is also specified. If the-@flag is used to specify a workload partition other than the current operating environment and the-uflag is specified, the list of user IDs must be numeric.-UUlist — Displays only information about processes with the user ID numbers or login names specified for the Ulist variable. The Ulist variable is either a comma-separated list of user IDs or a list of user IDs enclosed in double quotation marks (" ") and separated from one another by a comma and one or more spaces. The-Uflag only applies to the current operating environment unless the-@flag is also specified. If the-@flag is used to specify a workload partition other than the current operating environment and the-Uflag is specified, the list of user IDs must be numeric. In the listing, the ps command displays the numerical user ID unless the-fflag is used; then the command displays the login name. This flag is equivalent to the-uUlist flag. See also the u flag.-X— Prints all available characters of each user/group name instead of truncating to the first eight characters.-Z— Displays the page size settings of processes. DPGSZ Indicates the data page size of a process. SHMPGSZ Indicates the shared memory page size the process allocates. SPGSZ Indicates the stack page size of a process. TPGSZ Indicates the text page size of a process.-@[ WparName ] — Displays the process information that is associated with the workload partition WparName. If you do not specify the WparName parameter, the process information for all workload partitions is displayed. Workload partition information is displayed for all processes. You must specify other flags to the ps command to determine which process information to be displayed.
옵션(빼기 없는 BSD 형식)
다음 옵션은 앞에 빼기(-)를 붙이지 않습니다.
| 옵션 | 설명 |
|---|---|
a |
터미널이 있는 모든 프로세스를 보여 줍니다(보통은 자기 프로세스만). |
c |
프로세스 주소 공간의 명령 매개변수 대신, 회계용으로 시스템에 저장된 명령 이름을 보여 줍니다. |
e |
명령의 매개변수와 함께 환경을 80자까지 보여 줍니다. |
ew |
e의 출력을 한 줄 더 감싸 보여 줍니다. |
eww |
e의 출력을 감싸며 ENV 목록을 LINE_MAX까지 보여 줍니다. |
ewww |
e의 출력을 감싸며 ENV 목록을 INT_MAX까지 보여 줍니다. |
g |
모든 프로세스를 보여 줍니다. |
l |
F, S, UID, PID, PPID, C, PRI, NI, ADDR, SZ, PSS, WCHAN, TTY, TIME, CMD 필드의 긴 목록을 보여 줍니다. |
n |
숫자로 출력합니다. 긴 목록의 WCHAN을 기호 대신 숫자로, 사용자 목록의 USER를 UID로 보여 줍니다. |
s |
기본 출력 형식에 커널 스택 크기(SSIZ)를 보여 줍니다(시스템 관리자용). 다중 스레드 프로세스는 늘 0입니다. |
t tty |
제어 tty가 지정한 값인 프로세스를 보여 줍니다. tty는 ps가 출력하는 형태로 씁니다(/dev/tty/0은 0, /dev/lft0은 lft0, /dev/pts/2는 pts/2). |
u |
사용자 중심으로 USER, PID, %CPU, %MEM, SZ, RSS, TTY, STAT, STIME, TIME, COMMAND 필드를 보여 줍니다. |
v |
PGIN, SIZE, RSS, LIM, TSIZ, TRS, %CPU, %MEM 필드를 보여 줍니다. |
w |
넓은 열 형식(80열 대신 132열)으로 출력합니다. ww처럼 되풀이하면 제한 없이 넓게 출력합니다. 긴 명령을 얼마나 출력할지 정하는 데 씁니다. |
x |
제어 터미널이 있는 프로세스와 함께 제어 터미널이 없는 프로세스도 보여 줍니다. |
X |
사용자·그룹 이름을 자르지 않고 모두 출력합니다. |
영어 원문
The following options are not preceded by a minus sign (-):
- a — Displays information about all processes with terminals (ordinarily only the own processes of the user are displayed).
- c — Displays the command name, as stored internally in the system for purposes of accounting, rather than the command parameters, which are kept in the process address space.
- e — Displays the environment as well as the parameters to the command, up to a limit of 80 characters.
- ew — Wraps the display from the e flag one extra line.
- eww — Wraps the display from the e flag and displays the ENV list until the flag reaches the
LINE_MAXvalue. - ewww — Wraps the display from the e flag and displays the ENV list until the flag reaches the
INT_MAXvalue. - g — Displays all processes.
- l — Displays a long listing having the F, S, UID, PID, PPID, C, PRI, NI, ADDR, SZ, PSS, WCHAN, TTY, TIME, and CMD fields.
- n — Displays numerical output. In a long listing, the WCHAN field is printed numerically rather than symbolically. In a user listing, the USER field is replaced by a UID field.
- s — Displays the size (
SSIZ) of the kernel stack of each process (for use by system maintainers) in the basic output format. This value is always 0 (zero) for a multi-threaded process. - t tty — Displays processes whose controlling tty is the value of the tty variable, which should be specified as printed by the ps command; that is,
0for terminal /dev/tty/0,lft0for /dev/lft0, andpts/2for /dev/pts/2. - u — Displays user-oriented output. This includes the USER, PID, %CPU, %MEM, SZ, RSS, TTY, STAT, STIME, TIME, and COMMAND fields.
- v — Displays the PGIN, SIZE, RSS, LIM, TSIZ, TRS, %CPU, %MEM fields.
- w — Specifies a wide-column format for output (132 columns rather than 80). If repeated, (for example,
ww), uses arbitrarily wide output. This information is used to decide how much of long commands to print. - x — Displays processes without a controlling terminal in addition to processes with a controlling terminal.
- X — Prints the full user name or group name. The name is not truncated.
종료 상태
| 값 | 뜻 |
|---|---|
| 0 | 잘 끝났습니다. |
| 0보다 큼 | 오류가 났습니다. |
영어 원문
This command returns the following exit values:
- 0 — Successful completion.
>0— An error occurred.
보안
RBAC 사용자와 Trusted AIX 사용자는 주의하세요. 이 명령은 특권 작업을 할 수 있으며, 특권 작업은 특권 사용자만 할 수 있습니다. 이 명령에 걸린 특권과 권한(authorization) 목록은 lssecattr 명령이나 getcmdattr 하위 명령으로 봅니다.
영어 원문
Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.
예제
- 모든 프로세스를 보여 줍니다. 둘째 명령은 사용자 이름을 줄이지 않습니다.
ps -e -f
ps -X -e -f
- 특정 사용자의 프로세스를 나열합니다.
ps -f -l -ujim,jane,su
/dev/console과/dev/tty1에 딸린 프로세스를 나열합니다.
ps -t console,tty/1
- 터미널이 없는 프로세스를 나열합니다.
ps -t -
- 필드 지정자로 형식을 정해 보여 줍니다.
ppid=parent로 머리말을parent로 바꿨습니다.
ps -o ruser,pid,ppid=parent,args
RUSER PID parent COMMAND
helene 34 12 ps -o ruser,pid,ppid=parent,args
- 필드 기술자로 형식을 정해 보여 줍니다.
ps -o "< %u > %p %y : %a"
< RUSER > PID TT : COMMAND
< helene > 34 pts/3 : ps -o < %u > %p %y : %a
- 현재 터미널이 제어하는 프로세스와 커널 스레드를 보여 줍니다.
ps -lm
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
240003 A 26 8984 7190 1 60 20 2974 312 pts/1 0:00 -ksh
400 S - - - 1 60 - - - - - - -
200005 A 26 9256 8984 15 67 20 18ed 164 pts/1 0:00 ps
0 R - - - 15 67 - - - - - - -
- 모든 프로세스와 커널 스레드의 정보를 보여 줍니다.
ps -emo THREAD
USER PID PPID TID S C PRI SC WCHAN FLAG TTY BND CMD
jane 1716 19292 - A 10 60 1 * 260801 pts/7 - biod
- - - 4863 S 0 60 0 599e9d8 8400 - - -
- - - 5537 R 10 60 1 5999e18 2420 - 3 -
luke 19292 18524 - A 0 60 0 586ad84 200001 pts/7 - -ksh
- - - 7617 S 0 60 0 586ad84 400 - - -
luke 25864 31168 - A 11 65 0 - 200001 pts/7 - -
- - - 8993 R 11 65 0 - 0 - - -
- 64비트 프로세스를 모두 나열합니다.
ps -M
- 프로세스의 프로젝트 할당 정보를 보여 줍니다.
ps -P
- 프로세스의 페이지 크기 설정을 보여 줍니다.
ps -Z
PID TTY TIME DPGSZ SPGSZ TPGSZ SHMPGSZ CMD
41856 pts/15 0:00 4K 4K 4K 64K ps
84516 pts/15 0:00 4K 4K 4K 64K ksh
AIX ps의 예제 일부(-T로 트리 보기, -o THREAD,sched)는 원문에서 System V판 절의 예제로 이어 실려 있습니다. 아래 System V판 예제 11~14를 봅니다.
영어 원문
- To display all processes, type:
ps -e -f
To display all processes with expanded user name, type:
ps -X -e -f
- To list processes owned by specific users, type:
ps -f -l -ujim,jane,su
- To list processes that are associated with the /dev/console and /dev/tty1 ttys, type:
ps -t console,tty/1
- To list processes not associated with a terminal, type:
ps -t -
- To display a specified format with field specifiers, type:
ps -o ruser,pid,ppid=parent,args
The output is:
RUSER PID parent COMMAND
helene 34 12 ps -o ruser,pid,ppid=parent,args
- To display a specified format with field descriptors, type:
ps -o "< %u > %p %y : %a"
The output is:
< RUSER > PID TT : COMMAND
< helene > 34 pts/3 : ps -o < %u > %p %y : %a
- To display information about processes and kernel threads controlled by the current terminal, type:
ps -lm
The output is like:
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
240003 A 26 8984 7190 1 60 20 2974 312 pts/1 0:00 -ksh
400 S - - - 1 60 - - - - - -
200005 A 26 9256 8984 15 67 20 18ed 164 pts/1 0:00 ps
0 R - - - 15 67 - - - - - -
- To display information about all processes and kernel threads, type:
ps -emo THREAD
The output is like:
USER PID PPID TID S C PRI SC WCHAN FLAG TTY BND CMD
jane 1716 19292 - A 10 60 1 * 260801 pts/7 - biod
- - - 4863 S 0 60 0 599e9d8 8400 - - -
- - - 5537 R 10 60 1 5999e18 2420 - 3 -
luke 19292 18524 - A 0 60 0 586ad84 200001 pts/7 - -ksh
- - - 7617 S 0 60 0 586ad84 400 - - -
luke 25864 31168 - A 11 65 0 - 200001 pts/7 - -
- - - 8993 R 11 65 0 - 0 - - -
- To list all the 64-bit processes, type:
ps -M
- To display the project assignment details for the processes, type:
ps -P
- To display the page size settings of the processes, type:
ps -Z
The output is like:
PID TTY TIME DPGSZ SPGSZ TPGSZ SHMPGSZ CMD
41856 pts/15 0:00 4K 4K 4K 64K ps
84516 pts/15 0:00 4K 4K 4K 64K ksh
파일
| 파일 | 설명 |
|---|---|
/usr/bin/ps |
ps 명령이 들어 있습니다. |
관련 명령어: kill, nice. Performance management 안내서의 "Using the ps command"도 참고합니다.
영어 원문
- /usr/bin/ps — Contains the ps command.
- kill command, nice
command.
Using the ps command in Performance management.
System V판 ps(/usr/sysv/bin/ps)
AIX에는 System V R4 방식의 ps가 /usr/sysv/bin/ps로 따로 들어 있습니다. 플래그와 열 머리가 위의 AIX ps와 조금 다릅니다.
영어 원문
구문
/usr/sysv/bin/ps [ -a ] [ -A ] [ -c ] [ -d ] [ -e ] [ -f ] [ -j ] [ -l ] [ -L ] [ -P ] [ -y ] [ -g pgrplist ]
[ -o format ] [ -p proclist ] [ -s sidlist ] [ -t termlist ] [ { -u | -U } uidlist ] [ -G grplist ] [ -X ]
설명
ps 명령은 실행 중인 프로세스의 정보를 출력합니다. 플래그가 없으면 제어 터미널에 딸린 프로세스의 프로세스 ID, 터미널, 누적 실행 시간, 명령 이름을 보여 줍니다. 플래그에 따라 보이는 정보가 달라집니다.
출력 열 머리(괄호 안은 그 열을 보여 주는 플래그):
| 열 | 플래그 | 뜻 |
|---|---|---|
| F | -l |
프로세스(-L이면 스레드)의 플래그(16진수, 더한 값). 주요 값은 AIX ps의 F 표와 같습니다. |
| S | -l |
프로세스·커널 스레드의 상태. AIX ps의 S 표와 같습니다(프로세스의 I는 유휴). |
| UID | -f, -l |
소유자의 사용자 ID(-f면 로그인 이름) |
| PID | 모두 | 프로세스 ID |
| PPID | -f, -l |
부모 프로세스 ID |
| CLS | -c |
스케줄링 클래스. -c를 쓸 때만 출력 |
| NI | -l |
nice 값(sched_other 정책의 우선순위 계산) |
| PRI | -c, -l |
우선순위. 숫자가 클수록 낮음 |
| ADDR | -l |
프로세스 스택의 세그먼트 번호(커널 프로세스면 프로세스별 데이터 영역의 주소) |
| SZ | -l |
코어 이미지 크기(페이지 단위) |
| WCHAN | -l |
기다리거나 잠든 이벤트. 실행 중인 스레드는 빔, 프로세스는 잠든 스레드가 하나면 그 값, 아니면 * |
| STIME | -f, -u |
시작 시각(LANG이 표시 형태를 정함) |
| TTY | 모두 | 제어 터미널. -는 없음, ?는 알 수 없음 |
| TIME | 모두 | 전체 실행 시간 mm:ss(100분 넘으면 mmmm:ss) |
| LTIME | -L |
LWP(경량 프로세스) 하나의 실행 시간 |
| CMD | 모두 | 명령 이름. -f면 전체 이름과 매개변수 |
| LWP | -L |
커널 스레드의 tid |
| NLWP | -Lf |
프로세스의 커널 스레드 수 |
| PSR | -P |
커널 스레드가 묶인 논리 프로세서 번호. 프로세스는 모든 스레드가 같은 프로세서에 묶였을 때 표시 |
| RSS | -ly |
실제 메모리(상주 세트) 크기(1KB 단위) |
-o에 쓰는 필드 지정자:
| 필드 | 뜻 | 기본 머리말 |
|---|---|---|
addr |
프로세스 스택의 세그먼트 번호 | ADDR |
args |
전체 명령 이름과 인수 | COMMAND |
c |
CPU 사용량 | C |
class |
커널 스레드의 스케줄링 정책(sched_other, sched_fifo, sched_rr) |
CLS |
comm |
명령의 짧은 이름 | COMMAND |
etime |
경과 시간 [[dd-]hh:]mm:ss |
ELAPSED |
f |
플래그(16진수, 더한 값) | COMMAND(원문 그대로) |
fname |
실행 파일 기본 이름의 앞 8바이트 | COMMAND |
gid |
실효 그룹 ID(10진 정수) | GID |
group |
실효 그룹(이름, 안 되면 숫자) | GROUP |
lwp |
커널 스레드 ID | TID |
nice |
nice 값 | NI |
nlwp |
커널 스레드 수 | THCNT |
pcpu |
CPU 사용 백분율 | %CPU |
pgid |
프로세스 그룹 ID | PGID |
pid |
프로세스 ID | PID |
pmem |
실제 메모리 사용 백분율 | %MEM |
ppid |
부모 프로세스 ID | PPID |
pri |
우선순위 | PRI |
psr |
묶인 논리 프로세서 번호 | PSR |
rgid |
실제 그룹 ID(10진 정수) | RGID |
rgroup |
실제 그룹(이름, 안 되면 숫자) | RGROUP |
rss |
실제 메모리 크기(1KB 단위) | RSS |
ruid |
실제 사용자 ID(10진 정수) | RUID |
ruser |
실제 사용자(이름, 안 되면 숫자) | RUSER |
s |
프로세스 상태 | S |
sid |
세션 리더의 프로세스 ID | SID |
stime |
시작 시각 | STIME |
time |
누적 CPU 시간(etime과 같은 형식) |
TIME |
tty |
제어 터미널 이름 | TT |
uid |
실효 사용자 ID(10진 정수) | UID |
user |
실효 사용자(이름, 안 되면 숫자) | USER |
vsz |
코어 이미지 크기(KB, 10진 정수) | VSZ |
wchan |
기다리거나 잠든 이벤트 | WCHAN |
영어 원문
The ps command prints information about active processes. Without flags, ps prints information about processes associated with the controlling terminal. The output contains the process ID, terminal identifier, cumulative runtime, and the command name. The information displayed with flags varies accordingly.
Output
Depending on the flags used with the ps command, column headings vary for the information displayed. The headings are defined in the following list (flags that cause these headings to appear are shown in parentheses):
F (-l) Flags (hexadecimal and additive) associated with the process, or the thread if the -L option is specified. Some of the more important F field flags (hexadecimal and additive) associated with processes and threads are shown below:
| Flags | Hexadecimal Value | Definition |
|---|---|---|
| SLOAD | 0x00000001 | Indicates that the process is operating in core memory. |
| SNOSWAP | 0x00000002 | Indicates that the process cannot be swapped out. |
| STRC | 0x00000008 | Indicates that the process is being traced. |
| SKPROC | 0x00000200 | Indicates a Kernel process. |
| SEXIT | 0x00010000 | Indicates that the process is exiting. |
| SEXECED | 0x00200000 | Indicates that process has been run. |
| SEXECING | 0x01000000 | Indicates that the process is execing (performing an exec). |
| TKTHREAD | 0x00001000 | Indicates that the thread is a kernel only thread. |
Note: You can see the definitions of all process and thread flags by referring to the p_flags and t_flags fields in the /usr/include/sys/proc.h and /usr/include/sys/thread.h files respectively.
S (-l) The state of the process or kernel thread :
For processes:
O Nonexistent
A Active
W Swapped
I Idle
Z Canceled
T Stopped
For kernel threads:
O Nonexistent
R Running
S Sleeping
W Swapped
Z Canceled
T Stopped
UID (-f,- l) The user ID number of the process (the login name is printed under the -f option).
PID (all) The process ID of the process.
PPID (-f,-l) The process ID of the parent process.
CLS (-c) Scheduling class for the process. Printed only when the -c flag is used. NI (-l) The nice value of the process used in calculating priority for the sched_other policy.
PRI (-c, -l) The priority of the process or kernel thread. Higher numbers mean lower priority. ADDR (-l) Contains the segment number of the process stack, if normal; if a kernel process, the address of the preprocess data area.
SZ (-l) The size in pages of the core image of the process.
WCHAN(-l) The event for which the process or kernel thread is waiting or sleeping. For a kernel thread, this field is blank if the kernel thread is running. For a process, the wait channel is defined as the wait channel of the sleeping kernel thread if only one kernel thread is sleeping; otherwise a star is displayed.
STIME (-f,-u) The starting time of the process. The LANG environment variables control the appearance of this field.
TTY (all) The controlling terminal for the process:
- The process is not associated with a terminal.
? Unknown
TIME (all) The total runtime for the process. The time is displayed in the format of mm:ss or mmmm:ss if the runtime reaches 100 minutes, which is different from the displayed format if you use the -o time flag.
LTIME (-L) The runtime for an individual LWP.
CMD (all) Contains the command name. The full command name and its parameters are displayed with the -f flag.
LWP (-L) The tid of the kernel thread. NLWP(-Lf) The number of kernel threads in the process. PSR (-P) The logical processor number of the processor to which the kernel thread is bound (if any). For a process, this field is shown if all its threads are bound to the same processor.
RSS (-ly) The real memory (resident set) size of the process (in 1 KB units).
Format
The following list describes the field specifiers recognized by the system. These field specifiers can be used with the -o flag to specify the format for the output of the ps command.
The field specifiers recognized by the system are:
addr Indicates the segment number of the process stack, if normal; if a kernel process, the address of the preprocess data area. The default header for this field is ADDR.
args Indicates the full command name being executed. All command-line arguments are included, though truncation may occur. The default header for this field is COMMAND.
c CPU utilization of process or thread, incremented each time the system clock ticks and the process or thread is found to be running. The value is decayed by the scheduler by dividing it by 2 once per second. For the sched_other policy, CPU utilization is used in determining process scheduling priority. Large values indicate a CPU intensive process and result in lower process priority whereas small values indicate an I/O intensive process and result in a more favorable priority. The default header for this field is C.
class Indicates the scheduling policy for a kernel thread. The policies are sched_other, sched_fifo and sched_rr. The default header for this field is CLS.
comm Indicates the short name of the command being executed. Command-line arguments are not included. The default header for this field is COMMAND.
etime Indicates the elapsed time since the process started. The elapsed time is displayed in the format
[[ dd -] hh: ]mm :ss
where dd specifies the number of days, hh specifies the number of hours, mm specifies the number of minutes, and ss specifies the number of seconds.
The default header for this field is ELAPSED.
f Indicates flags (hexadecimal and additive) associated with the process. The default header for this field is COMMAND.
fname Indicates the first 8 bytes of the base name of the process's executable file. The default header for this field is COMMAND.
gid Indicates the effective group ID number of the process as a decimal integer. The default header for this field is GID. The login name is printed under the -f option.
group Indicates the effective group ID of the process. The textual group ID is displayed. If the textual group ID cannot be obtained, a decimal representation is used. The default header for this field is GROUP.
lwp Indicates the thread ID of the kernel thread. The default header for this field is TID.
nice Indicates the decimal value of the process nice value. The default header for this field is NI.
nlwp Indicates the number of kernel threads owned by the process. The default header for this field is THCNT. pcpu Indicates the ratio of CPU time used to CPU time available, expressed as a percentage. The default header for this field is %CPU.
pgid Indicates the decimal value of the process group ID. The default header for this field is PGID.
pid Indicates the decimal value of the process ID. The default header for this field is PID.
pmem Indicates the percentage of real memory used by this process. The default header for this field is %MEM.
ppid Indicates the decimal value of the parent process ID. The default header for this field is PPID.
pri Indicates the priority of the process or kernel thread ; higher numbers mean lower priority. The default header for this field is PRI.
psr Indicates the logical processor number of the processor to which the kernel thread is bound (if any). The default header for this field is PSR.
rgid Indicates the real group ID number of the process as a decimal integer. The default header for this field is RGID.
rgroup Indicates the real group ID of the process. The textual group ID is displayed. If the textual group ID cannot be obtained, a decimal representation is used. The default header for this field is RGROUP.
rss Indicates the real memory (resident set) size of the process (in 1 KB units). The default header for this field is RSS.
ruid Indicates the real user ID number of the process as a decimal integer. The default header for this field is RUID.
ruser Indicates the real user ID of the process. The textual user ID is displayed. If the textual user ID cannot be obtained, a decimal representation is used. The default header for this field is RUSER.
s Indicates the state of the process. The default header for this field is S.
sid Indicates the process ID of the session leader. The default header for this field is SID.
stime Indicates the starting time of the process. The LANG environment variables control the appearance of this field. The default header for this field is STIME.
time Indicates the cumulative CPU time since the process started. The time is displayed in the same format as in etime. The default header for this field is TIME.
tty Indicates the controlling terminal name of the process. The default header for this field is TT.
uid Indicates the effective user ID number of the process as a decimal integer. The default header for this field is UID.
user Indicates the effective user ID of the process. The textual user ID is displayed. If the textual user ID cannot be obtained, a decimal representation is used. The default header for this field is USER.
vsz Indicates, as a decimal integer, the size in kilobytes of the core image of the process. The default header for this field is VSZ.
wchan Indicates the event for which the process or kernel thread is waiting or sleeping. For a kernel thread, this field is blank if the kernel thread is running. For a process, the wait channel is defined as the wait channel of the sleeping kernel thread if only one kernel thread is sleeping; otherwise a star is displayed.
The default header for this field is WCHAN.
플래그
목록을 받는 플래그의 항목은 쉼표로 나누거나, 큰따옴표로 감싸 쉼표나 빈칸으로 나눕니다. proclist와 pgrplist는 숫자여야 합니다.
| 플래그 | 설명 |
|---|---|
-a |
세션 리더와 터미널이 없는 프로세스를 뺀 모든 프로세스의 정보를 씁니다. |
-A |
모든 프로세스의 정보를 씁니다. |
-c |
스케줄러 특성을 반영한 형식으로 출력합니다. -f, -l의 출력에 영향을 줍니다. |
-d |
세션 리더를 뺀 모든 프로세스의 정보를 씁니다. |
-e |
커널 프로세스를 뺀 모든 프로세스의 정보를 씁니다. |
-f |
전체 목록을 만듭니다. |
-g pgrplist |
pgrplist에 지정한 프로세스 그룹의 프로세스만 씁니다(숫자). |
-G grplist |
grplist에 지정한 그룹의 프로세스만 씁니다. 그룹 이름을 받습니다. |
-j |
세션 ID와 프로세스 그룹 ID를 보여 줍니다. |
-l |
긴 목록을 만듭니다. |
-L |
프로세스 안의 활성 스레드 상태를 출력합니다. |
-o format |
format 형식으로 보여 줍니다. 필드 지정자는 위 표와 같습니다. |
-p proclist |
proclist에 지정한 프로세스 번호의 프로세스만 보여 줍니다(숫자). |
-P |
프로세스의 주 커널 스레드가 묶인 논리 프로세서 번호를 보여 줍니다. |
-s sidlist |
sidlist에 지정한 세션 리더 ID의 모든 프로세스를 보여 줍니다. |
-t termlist |
termlist에 지정한 터미널에 딸린 프로세스만 보여 줍니다. |
-u uidlist |
uidlist에 지정한 사용자 ID나 로그인 이름의 프로세스만 보여 줍니다. |
-U uidlist |
-u와 같습니다. |
-X |
사용자·그룹 이름을 앞 8자로 자르지 않고 모두 출력합니다. |
-y |
-l과 함께 쓰면 RSS와 SZ를 KB로 출력하고 F와 ADDR는 출력하지 않습니다. |
영어 원문
Some flags accept lists as arguments. Items in a list can be either separated by commas or else enclosed in double quotes and separated by commas or spaces. Values for proclist and pgrplist must be numeric.
-a— Writes to standard output information about all processes, except the session leaders and processes not associated with a terminal.-A— Writes to standard output information about all processes.-c— Prints information in a format that reflects scheduler properties. The-cflag affects the output of the-fand-lflags, as described below.-d— Writes to standard output information about all processes, except the session leaders.-e— Writes to standard output information about all processes, except kernel processes.-f— Generates a full listing.-gpgrplist — Writes to standard output information only about processes that are in the process groups specified by pgrplist. Values for pgrplist must be numeric.-Ggrplist — Writes to standard output information only about processes that are in the process groups specified by grplist. The-Gflag accepts group names.-j— Displays session ID and process group ID.-l— Generates a long listing.-L— Prints status of active threads within a process.-oformat — Displays information in the format specified by format. Multiple field specifiers can be specified for the format variable. The field specifiers that can be used with the-oflag are described above in the Format section.-pproclist — Displays information only about processes with the process numbers specified by proclist. Values for proclist must be numeric.-P— Displays the logical processor number of the processor to which the primary kernel thread of the process is bound (if any).-ssidlist — Displays all processes whose session leader's IDs are specified by sidlist.-ttermlist — Displays information only about processes associated with the terminals specified by termlist.-uuidlist — Displays information only about processes with the user ID numbers or login names specified by uidlist.-Uuidlist — Displays information only about processes with the user ID numbers or login names specified by uidlist.-X— Prints all available characters of each user and group name instead of truncating to the first 8 characters.-y— When combined with the-loption, changes the long listing so that it prints the "RSS'' and "SZ'' fields in kilobytes and does not print the "F'' and "ADDR'' fields.
종료 상태
| 값 | 뜻 |
|---|---|
| 0 | 잘 끝났습니다. |
| 0보다 큼 | 오류가 났습니다. |
영어 원문
This command returns the following exit values:
- 0 — Successful completion.
>0— An error occurred.
보안
RBAC 사용자와 Trusted AIX 사용자는 주의하세요. 이 명령은 특권 작업을 할 수 있으며, 특권 작업은 특권 사용자만 할 수 있습니다. 특권과 권한 목록은 lssecattr 명령이나 getcmdattr 하위 명령으로 봅니다.
영어 원문
Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.
예제
아래 110은 System V판 예제이고, 1114는 원문에서 이 절에 이어 실린 AIX ps(-T, -X, -o THREAD,sched)의 예제입니다.
- 모든 프로세스를 보여 줍니다.
ps -e -f
- 사용자
guest의 프로세스를 나열합니다.
ps -f -l -u guest
/dev/pts/0과/dev/pts/1에 딸린 프로세스를 나열합니다.
ps -t pts/0,pts/1
- 터미널이 없는 프로세스를 나열합니다.
ps -t -
- 필드 지정자로 형식을 정해 보여 줍니다.
ps -o ruser,pid,ppid,args
- 프로세스 안의 모든 커널 스레드 정보를 보여 줍니다.
ps -L
- 모든 프로세스의 세션 ID와 프로세스 그룹 ID를 보여 줍니다.
ps -jA
- 프로세스의 스케줄링 클래스와 우선순위를 보여 줍니다.
ps -c -l
- 커널 스레드 정보와 프로세스의 커널 스레드 수를 보여 줍니다.
ps -L -f
- 프로세스나 커널 스레드가 묶인 프로세서를 보여 줍니다.
ps -P
- 주어진 프로세스(여기서는
inetd)를 뿌리로 ASCII 그림 트리를 출력합니다(출력 일부).
ps -T 14220
PID TTY TIME CMD
14220 - 0:00 inetd
16948 - 0:00 |\--telnetd
32542 pts/4 0:00 | \--ksh
26504 - 0:00 |\--telnetd
41272 pts/5 0:00 | \--ksh
26908 pts/5 0:00 | \--vi
105716 - 0:00 \--telnetd
29508 pts/1 0:00 \--ksh
39478 pts/1 0:00 \--ksh
38392 pts/1 0:00 \--vi
- 주어진 pid를 뿌리로 하는 모든 프로세스의 정보를 출력합니다.
ps -fL 14220
UID PID PPID C STIME TTY TIME CMD
root 14220 8676 0 Apr 07 - 0:00 /usr/sbin/inetd
root 16948 14220 0 Apr 06 - 0:00 telnetd -a
root 23612 35750 0 Apr 10 pts/3 0:00 -ksh
root 24830 28602 1 18:30:56 pts/0 0:00 -ksh
root 28602 14220 0 18:30:55 - 0:00 telnetd -a
root 32542 16948 0 Apr 06 pts/4 0:00 -ksh
root 34466 14220 0 Apr 10 - 0:00 rpc.ttdbserver 100083 1
root 35750 14220 0 Apr 10 - 0:00 telnetd -a
root 40228 24830 8 18:36:01 pts/0 0:00 ps -fL 14220
- 사용자 이름을 줄이지 않고 모든 프로세스를 보여 줍니다.
ps -X -e -f
- 스레드의 스케줄링 정책을 보여 줍니다(6.1). 맨 오른쪽 SCH 열이 정책입니다(
0은sched_other).
ps -m -o THREAD,sched
영어 원문
- To display all processes, enter:
ps -e -f
- To list processes owned by the user 'guest', enter:
ps -f -l -u guest
- To list processes that are associated with the /dev/pts/0 and /dev/pts/1 terminals, enter:
ps -t pts/0,pts/1
- To list processes not associated with a terminal, enter:
ps -t -
- To display a specified format with field specifiers, enter:
ps -o ruser,pid,ppid,args
- To display information about all kernel threads in a process, enter:
ps -L
- To display session ID and process group IDs of all the processes, enter:
ps -jA
- To display the scheduling class and priority of processes, enter:
ps -c -l
- To display information about kernel threads and the number of kernel threads in a process, enter:
ps -L -f
- To display the processor to which the process or kernel thread is bound to, enter:
ps -P
- To print an ASCII art for a given process (
inetdin the example below), enter :
ps -T 14220
Output will look like the following:
PID TTY TIME CMD
14220 - 0:00 inetd
16948 - 0:00 |\--telnetd
32542 pts/4 0:00 | \--ksh
26504 - 0:00 |\--telnetd
41272 pts/5 0:00 | \--ksh
26908 pts/5 0:00 | \--vi
28602 - 0:00 |\--telnetd
24830 pts/0 0:00 | \--ksh
676416 pts/0 0:00 | \--ksh
29984 - 0:00 |\--telnetd
38546 pts/6 0:00 | \--ksh
32126 - 0:00 |\--telnetd
11162 pts/7 0:00 | \--ksh
34466 - 0:00 |\--rpc.ttdbserver
35750 - 0:00 |\--telnetd
23612 pts/3 0:00 | \--ksh
36294 - 0:00 |\--telnetd
38096 pts/8 0:00 | \--ksh
39740 - 0:00 |\--telnetd
42226 pts/9 0:01 | \--ksh
40632 - 0:00 |\--telnetd
40232 pts/2 0:00 | \--ksh
32910 pts/2 0:00 | \--dbx
987990 pts/2 0:00 | \--a.out
40722 - 0:00 |\--telnetd
16792 pts/10 0:00 | \--ksh
37886 pts/10 0:00 | \--ps
105716 - 0:00 \--telnetd
29508 pts/1 0:00 \--ksh
39478 pts/1 0:00 \--ksh
38392 pts/1 0:00 \--vi
- To print information about all processes rooted at a given pid, enter:
ps -fL 14220
Output will look like the following:
UID PID PPID C STIME TTY TIME CMD
root 14220 8676 0 Apr 07 - 0:00 /usr/sbin/inetd
root 16948 14220 0 Apr 06 - 0:00 telnetd -a
root 23612 35750 0 Apr 10 pts/3 0:00 -ksh
root 24830 28602 1 18:30:56 pts/0 0:00 -ksh
root 28602 14220 0 18:30:55 - 0:00 telnetd -a
root 32542 16948 0 Apr 06 pts/4 0:00 -ksh
root 34466 14220 0 Apr 10 - 0:00 rpc.ttdbserver 100083 1
root 35750 14220 0 Apr 10 - 0:00 telnetd -a
root 40228 24830 8 18:36:01 pts/0 0:00 ps -fL 14220
- To display all processes with expanded user name, type:
ps -X -e -f
- To display the scheduling policies of a thread, enter the following command:
#ps -m -o THREAD,sched
USER PID PPID TID ST CP PRI SC WCHAN F TT BND COMMAND SCH
suresana 1609830 4227284 - A 16 68 1 - 200001 pts/144 - ps -m
-o THREAD sched 0
- - - 6381739 R 16 68 1 -400000 - - - 0
suresana 4227284 4239476 - A 1 60 1 -200801 pts/144 - bash 0
- - - 4177981 S 1 60 1 -410400 - - - 0
suresana 4239476 921694 - A 0 60 1 -240001 pts/144 - -ksh 0
- - - 5554385 S 0 60 1 -10400 - - - 0
파일
| 파일 | 설명 |
|---|---|
/usr/sysv/bin/ps |
System V R4판 ps 명령이 들어 있습니다. |
/etc/passwd |
사용자 ID 정보가 들어 있습니다. |
/dev/pty* |
터미널(PTY) 이름입니다. |
/dev/tty* |
터미널(TTY) 이름입니다. |
관련 명령어: nice, kill
영어 원문
- /usr/sysv/bin/ps — Contains the System V R4 ps command.
- /etc/passwd — Contains the user ID information.
/dev/pty*— Indicates terminal (PTY) names./dev/tty*— Indicates terminal (TTY) names.
Related reference:
- nice Command
Related information:
- kill command
- Using the ps command
리눅스(GNU)와 다른 점
| 항목 | AIX 5.3·6.1 | 리눅스 procps ps |
|---|---|---|
-T pid |
pid를 뿌리로 한 프로세스 트리 | 현재 터미널의 스레드 표시(트리는 --forest, -H) |
-L pidlist |
자손 프로세스 나열 | 스레드(LWP) 표시 |
-M |
64비트 프로세스 | 보안 문맥(SELinux) |
-Z |
페이지 크기 설정 | 보안 문맥 |
-P |
프로젝트 정보 | 프로세서 번호(PSR) 열 |
-@ |
WPAR(6.1) | 없음 |
ps aux |
같은 BSD 형식 | 같음 |
같은 글자의 플래그가 뜻이 다른 것이 많으니, 리눅스에서 쓰던 ps -eLf나 ps -T를 AIX에서 그대로 쓰면 결과가 다릅니다. 스레드를 보려면 AIX에서는 ps -emo THREAD를 씁니다.