w 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-w
핵심 정리
- 시스템의 현재 활동을 요약합니다. 머리줄에 현재 시각, 가동 시간, 사용자 수, 부하 평균(1·5·15분)을 보여 줍니다.
- 사용자마다 User, tty, login@(로그인 시각), idle(유휴 분), JCPU, PCPU, What(현재 명령)을 보여 줍니다.
-h는 머리줄을 빼고,-s는 짧은 형식,-u만 주면uptime과 같습니다.- 사용자 이름을 주면 그 사용자만 보여 줍니다.
-X는 긴 사용자 이름을 자르지 않습니다. - 로그인 시각은 24시간 안이면
10:25am, 7일 안이면Tue10am, 그보다 오래면12Mar91형태입니다. - 6.1에서
-@ [WPAR](워크로드 파티션별 활동)가 생겼습니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1에서 -@ 플래그와 WPAR 열이 더해짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 6, 6.1 Volume 6 |
| 파일 | /etc/utmp |
| 관련 명령어 | who, uptime, ps |
목적
현재 시스템 활동의 요약을 출력합니다.
영어 원문
Prints a summary of current system activity.
구문
w [ -h ] [ -u ] [ -w ] [ -l | -s ] [ -X ] [ -@ [ WPAR ] ] [ User ]
-@는 6.1 구문에만 있습니다.
설명
w 명령은 시스템의 현재 활동을 요약해 출력합니다. 요약에는 다음이 들어갑니다.
| 열 | 뜻 |
|---|---|
| WPAR | 워크로드 파티션 이름(6.1) |
| User | 로그인한 사용자 |
| tty | 사용자가 쓰는 tty 이름 |
| login@ | 로그인한 시각 |
| idle | 프로그램이 마지막으로 터미널에서 읽으려 한 뒤 지난 분. (6.1) clogin으로 WPAR에 로그인하면 유휴 시간은 전역 환경의 터미널에서 가져옵니다. |
| JCPU | 그 터미널의 모든 프로세스와 자식이 쓴 시스템 시간 |
| PCPU | 현재 활성 프로세스가 쓴 시스템 시간 |
| What | 현재 프로세스의 이름과 인수 |
요약의 머리줄은 현재 시각, 시스템이 켜져 있던 시간, 로그인한 사용자 수, 부하 평균을 보여 줍니다. 부하 평균은 지난 1분, 5분, 15분 동안 실행할 수 있는 프로세스의 수입니다.
로그인 시각 필드는 다음 형식으로 나옵니다.
| 형식 | 뜻 |
|---|---|
10:25am |
최근 24시간 안에 로그인 |
Tue10am |
24시간에서 7일 사이에 로그인 |
12Mar91 |
7일보다 전에 로그인 |
User 매개변수로 사용자 이름을 주면 그 사용자로 출력을 제한합니다.
영어 원문
The w command prints a summary of the current activity on the system. The summary includes the following:
- WPAR — Workload partition name.
- User — Who is logged on.
- tty — Name of the tty the user is on.
- login@ — Time of day the user logged on.
- idle — Number of minutes since a program last attempted to read from the terminal. Note: The idle time is taken from the global terminal when you log into wpar using the clogin command.
- JCPU — System unit time used by all processes and their children on that terminal.
- PCPU — System unit time used by the currently active process.
- What — Name and arguments of the current process.
The heading line of the summary shows the current time of day, how long the system has been up, the number of users logged into the system, and the load average. The load average is the number of runnable processes over the preceding 1-, 5-, 15-minute intervals.
The following examples show the different formats used for the login time field:
10:25am— The user logged in within the last 24 hours.Tue10am— The user logged in between 24 hours and 7 days.12Mar91— The user logged in more than 7 days ago.
If a user name is specified with the User parameter, the output is restricted to that user.
플래그
| 플래그 | 설명 |
|---|---|
-@ [WPAR] |
워크로드 파티션 이름을 붙여 시스템 활동을 출력합니다(아래 설명). 6.1부터 |
-h |
머리줄을 빼고 출력합니다. |
-l |
긴 형식으로 출력합니다. 기본입니다. |
-s |
짧은 형식으로 출력합니다. tty를 줄이고, 로그인 시각, 시스템 시간, 명령 인수를 뺍니다. |
-u |
현재 시각, 마지막 시스템 시작 뒤 지난 시간, 로그인한 사용자 수, 실행 중인 프로세스 수를 출력합니다. 기본입니다. -w나 -h 없이 -u만 쓰면 uptime 명령과 같습니다. |
-w |
-u와 -l을 함께 지정한 것과 같으며, 기본입니다. |
-X |
사용자 이름을 앞 8자로 자르지 않고 모두 출력하며, 사용자 이름을 출력의 마지막 열로 옮깁니다. |
-@의 동작(6.1):
- WPAR 이름 없이
-@를 주면 전역 환경과 시스템에서 활성인 모든 WPAR의 활동을 보여 주며, 머리줄은 전역 환경의 값입니다. - WPAR 이름과 함께 주면 그 WPAR의 활동을 보여 주며, 머리줄도 그 WPAR의 값입니다.
-@ Global을 주면 전역 환경의 활동과 값을 보여 줍니다.-@를 주지 않으면w를 실행하는 현재 WPAR이나 전역 환경을 보여 줍니다.
영어 원문
-@— Prints the System activity tagged with a workload partition name: • providing the-@option without a WPAR name indicates the global environment in addition to all WPARs active in the system, and the heading line indicates values for the global environment only • providing the-@option with a WPAR name indicates the activity, and the heading line indicates values for only that WPAR • providing-@Global indicates the activity, and the heading line indicates values for the global environment only. Note: Not providing the-@option indicates that the current WPAR or global environment, wherever the w command is running.-h— Suppresses the heading.-l— Prints the summary in long form. This is the default.-s— Prints the summary in short form. In the short form, the tty is abbreviated, and the login time, system unit time, and command arguments are omitted.-u— Prints the time of day, amount of time since last system startup, number of users logged on, and number of processes running. This is the default. Specifying the-uflag without specifying the-wor-hflag is equivalent to the uptime command.-w— The equivalent of specifying the-uand-lflags, which is the default.-X— Prints all available characters of each user name instead of truncating to the first 8 characters. The user name is also moved to the last column of the output.
파일
| 파일 | 설명 |
|---|---|
/etc/utmp |
사용자 목록이 들어 있습니다. |
관련 명령어: who, uptime
예:
w
w -h
w -s root
영어 원문
- /etc/utmp — Contains the list of users.
Related reference:
- who Command
Related information:
- uptime command
리눅스(GNU)와 다른 점
리눅스의 w(procps)도 같은 열(USER, TTY, LOGIN@, IDLE, JCPU, PCPU, WHAT)과 -h, -s, -u 플래그를 씁니다. 다만 리눅스의 -u는 "현재 프로세스와 CPU 시간을 계산할 때 사용자 이름을 무시"라는 다른 뜻이고, 리눅스에는 -f(FROM 열 켜고 끄기)와 -i가 있습니다.