'⑨ 직무역량강화/Unix'에 해당되는 글 9

  1. 2012/05/15 [Unix] vi/vim 단축키 모음
  2. 2012/02/15 [Unix] tar/untar (1)
  3. 2011/12/14 [Unix] 유닉스 명령어 (Network & Others)
  4. 2011/12/14 [Unix] 유닉스 명령어 (HP-UX)
  5. 2011/12/14 [Unix] 유닉스 명령어 (IBM AIX)
⑨ 직무역량강화/Unix | Posted by 서풍의신 재령 2012/05/15 14:18

[Unix] vi/vim 단축키 모음


▲ 클릭하면 커져요

크리에이티브 커먼즈 라이선스
Creative Commons License
⑨ 직무역량강화/Unix | Posted by 서풍의신 재령 2012/02/15 15:12

[Unix] tar/untar

Unix 환경에서 tar 묶고 풀 일이 없다보니 가끔 쓸 때마다 옵션이 맨날 헛갈려서 가져옴.

- tar 풀기 (untar)

1) tar xvf xxx.tar -C /home/directory/ 

2) tar xvf /home/directory/ xxx.tar

** -C 는 디렉토리를 경로를 가리키며 -C 로 경로를 만들어 놓으면 그 경로에 xxx.tar 가 풀리게 됨 

- tar 묶기 (tar)

tar cvf xxxx.tar yyyy
 
yyyy 라는 폴더를 xxxx.tar 로 묶는다는 것. (하위 디렉토리 포함)
 
- tar options
 
 -x, --extract, --get    아카이브에서 파일을 추출합니다
 -v, --verbose         verbosely list files processed
      --checkpoint      print directory names while reading the archive
      --check-links     print a message if not all links are dumped
      --totals          print total bytes written while creating archive
      --index-file=FILE send verbose output to FILE
      --utc             print file modification dates in UTC
 -f, --file=ARCHIVE             use archive file or device ARCHIVE
     --force-local              archive file is local even if has a colon
     --rmt-command=COMMAND      use given rmt COMMAND instead of /etc/rmt
     --rsh-command=COMMAND      use remote COMMAND instead of rsh

크리에이티브 커먼즈 라이선스
Creative Commons License
⑨ 직무역량강화/Unix | Posted by 서풍의신 재령 2011/12/14 11:14

[Unix] 유닉스 명령어 (Network & Others)

참고 URL (출처) : http://atc.altibase.com/sub08/html_manual/a3/htm/admin/apb.html

NETWORK & OTHERS

 

Interface 확인, Interface 이름 확인.

l netstat -in

 

% netstat -in

Name  Mtu  Net/Dest    Address    Ipkts  Ierrs Opkts  Oerrs Collis Queue

lo0   8232 127.0.0.0     127.0.0.1    67063018 0   67063018  0  0  0   

hme0  1500 192.168.1.0  192.168.1.11  20010913 0   20528248  0   0  0

 

Routing Table 이름 표시

l netstat -rn

 

% netstat -rn

Routing Table:

  Destination           Gateway           Flags  Ref   Use   Interface

-------------------- -------------------- ----- ----- ------ ---------

192.168.1.0         192.168.1.11          U        3   4550  hme0

224.0.0.0            192.168.1.11         U        3      0  hme0

default               192.168.1.1          UG       0   2013

127.0.0.1               127.0.0.1          UH       066836525  lo0

 

UDP, TCP, Active UNIX domain sockets 등의 정보가 표시된다.

l netstat -an

 

l Ifconfig

 

% ifconfig –a

 

lo0: flags=849<UP,LOOPBACK,RUNNING,MULTICAST> mtu 8232

        inet 127.0.0.1 netmask ff000000

hme0:flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST>mtu 1500

        inet 192.168.1.11 netmask ffffff00 broadcast 192.168.1.255

 

l iostat

 

% iostat -x 30

 

                                   extended device statistics

device    r/s  w/s   kr/s   kw/s wait actv  svc_t  %w  %b

sd6       0.0  0.0    0.0    0.0  0.0  0.0    0.0   0   0

ssd1      0.2  1.5    2.6   17.1  0.2  0.1  202.9   1   1

ssd3      0.1  1.3    1.2  129.6  0.0  0.0   55.9   0   1

ssd4      0.2  0.8    3.9   31.8  0.1  0.0   77.3   0   0

ssd8      0.5  3.4    7.1  137.2  0.5  0.1  158.4   0   3

ssd9      0.1  0.6    1.8   20.6  0.1  0.0  200.8   0   0

ssd10     0.9 12.0   10.8  320.1  1.5  0.4  146.0   1   9

ssd11     0.8 20.5    7.8  724.7  1.0  0.6   72.4   0  11

ssd12     0.3  2.5    3.7   53.8  0.3  0.1  121.0   0   2

nfs2      0.0  0.0    0.0    0.0  0.0  0.0    0.0   0   0

 

 

1. svc_t (avque + avwait) : disk 응답시간

10 - 50 acceptable

100 - 1500 not acceptable

 

2. %b : 디스크를 얼마나 많이 쓰는가?

5% 이하는 무시

60% 이상이면 조정할 필요가 있다.

 

OS 부팅된 시점의 시간, 로드평균 정보표시

l uptime

 

% uptime

11:52am  up 0:35, 1 user, load average: 0.04, 0.01, 0.02

 

Load 골고루 분산되는지 확인할 .

l mpstat (sun)

 

l sar (sun)

 

% sar -g 1 5

 

-g(report paging activities)

-q(report on queue activity)

-r(report unused memory and disk blocks)

-u(report CPU utilization)

크리에이티브 커먼즈 라이선스
Creative Commons License
⑨ 직무역량강화/Unix | Posted by 서풍의신 재령 2011/12/14 11:07

[Unix] 유닉스 명령어 (HP-UX)

참고 URL (출처) : http://atc.altibase.com/sub08/html_manual/a3/htm/admin/apb.html

HP-UX

 

CPU 관련

 

CPU 정보 확인

l glance (화면출력 a)

 

CPU  State     Util   LoadAvg(1/5/15 min)   CSwitch   Last Pid

--------------------------------------------------------------------------------

  0 Unknown     1.5     0.6/  0.6/  0.7       742        1008

  1 Unknown     2.3     1.0/  1.0/  1.1       708       21042

 

l model (Hz 표시)

 

정확한 결과는 아니다. 하지만 root 권한이 필요하지 않다는 장점이 있다.

끝에 44 표시된 부분이 440 MHz 말한다.

 

% model

 

9000/800/L1000-44

 

l sam (root)

 

% sam -> performance monitor -> system properties ->

 

이동(tab), 선택(space bar)

Processors:                                                     

Active:                   2

Total:                    2

CPU Version:             2.0 PA8500

Clock Frequency:        440 MHz

Machine Identification:   527706557

Hardware Model:         9000/800/L1000-44

Kernel Width Support:    64

 

CPU 사용량 확인

l glance

 

l top

 

메모리 관련

 

메모리 정보 확인

l sam (root)

 

% sam -> performance monitor -> system properties ->

 

이동(tab), 선택(space bar)

 

Physical Memory:          2049.8 MB

Real Memory:

Active:                  274282.9 KB

Total:                   586006.5 KB

Virtual Memory:

Active:                  431045.1 KB

Total:                   815797.4 KB

Free Memory Pages:  263434 at 4 KB/page

Swap Space:

Avail:                        4096 MB

Used:                         745 MB

 

l dmesg

 

여러 정보가 출력 아래에 결과 표시

Memory Information:

physical page size = 4096 bytes, logical page size = 4096 bytes

physical: 2097152 Kbytes, lockable: 1562592 Kbytes,

available: 1800988 Kbytes

 

프로세스 메모리 확인

l ps -elf

 

% ps -elf | grep altibase

401 R  qa32 21042  1  0 152 20  4e73d340 40727   - 08:04:18 - 14:37 /user5/qa32/ altibase -a boot

 

l glance (root)

 

시스템 메모리 확인

l %vmstat -p 1 10

 

Usage: vmstat [-cisS] [disk ...] [interval [count]]

 

%vmstat 1 1

 

시스템 관련

 

LOG 확인

l syslog

 

% vi /var/adm/syslog/syslog.log      (새로운 로그파일)

% vi /var/adm/syslog/OLDsyslog.log  (이전   로그파일)

 

운영 체제 버전 확인

l uname

 

% uname -a

HP-UX hp B.11.11 U 9000/800 527706557 unlimited-user license

 

패치 번호 확인

l swlist

 

% swlist -l product | grep libc

PHCO_24400            1.0            libc cumulative patch

PHCO_24402            1.0            libc cumulative header file patch

 

디스크 관련

 

디스크 I/O 정보

l iostat

 

%iostat 3 1

 

device    bps     sps    msps

c2t0d0      0     0.0     1.0

c1t0d0      0     0.0     1.0

 

크리에이티브 커먼즈 라이선스
Creative Commons License
⑨ 직무역량강화/Unix | Posted by 서풍의신 재령 2011/12/14 11:05

[Unix] 유닉스 명령어 (IBM AIX)

참고 URL (출처) : http://atc.altibase.com/sub08/html_manual/a3/htm/admin/apb.html

IBM (AIX)

 

CPU 관련

 

CPU 정보 확인

l topas

 

sys : 커널이 사용하는 process time slice 대한 백분율.

User : 사용자 프로그램에서 사용하는 사용율.

Idle : 지금 사용되고 있지 않은 부분.

Wio : 디스크에서의 응답을 기다리는 부분을 말하는데 부분은 다른 프로세스가 올라와서 리소스 요청을 하면 사용될 있는 부분

 

l sar -P ALL 3 10 (root)

Usage : sal <increment> <number>

 

% sar -P ALL 1 2

 

AIX aix 1 5 0001D01F4C00    05/20/03

 

12:54:00 cpu    %usr    %sys    %wio   %idle

12:54:02  0       32      52      15       1

                1       31      45      19       4

                -       31      49      17       2

12:54:03  0       25      48       7      20

                1       36      34       9      21

                -       32      40       8      20

평균          0       29      50      11       9

                1       34      39      13      14

-       32      45      12      11

 

l lsattr -El proc0 (5L)

 

state     enable             프로세서 상태 거짓

type      PowerPC_RS64-III 프로세서 유형 거짓

frequency 601600000        프로세서 속도 거짓

 

CPU 사용량 확인

l TOP

 

메모리 관련

 

메모리 정보 확인

l topas

 

Memory : 물리적 메모리와 페이징 영역에 대한 부분을 보여준다.

물리적 메모리는 일단 계산 가능 영역(computational area) 있고 계산 불가 영역(noncomputational area) 있는데 계산 가능 영역(computational) 프로세스가 사용하는 메모리의 부분이고 계산 불가 영역(noncomputational area) 파일 캐시(file cache)용도로 사용하는 부분을 말한다. paging in, out 대한 부분도 보여주고 외에도 top process 디스크 등의 사용율을 보여준다.

 

l svmon -G

 

size        inuse       free         pin        virtual

memory   1048565    901587     146978    56480     216102

pg space  753664      41379

               work       pers       clnt

pin           56480          0          0

in use      180237     721350          0

 

프로세스 메모리 확인

l ps -aux

 

시스템에서 진행 중인 프로세스에 대한 정보를 %CPU, %MEM, RSS 값과 함께 보여준다.

l svmon -P <pid>

 

% svmon -P 13658

 

시스템 메모리 확인

l %vmstat -p 1 10

 

Usage: vmstat [-cisS] [disk ...] [interval [count]]

 

%vmstat 1 1

 

Memory Top 3 확인

l svmon -uP -t 3 | grep -p Pid 또는 svmon -P -t 3 -p

 

% svmon -uP -t 3 | grep -p Pid

 

-------------------------------------------------------------------------------

     Pid Command    Inuse  Pin   Pgsp  Virtual  64-bit   Mthrd

   31462   at       95870  1605  1949  39704    Y       Y

 

-------------------------------------------------------------------------------

     Pid Command    Inuse  Pin  Pgsp  Virtual   64-bit    Mthrd

   26852   at       20352  1607  1841  14624    Y        Y

 

-------------------------------------------------------------------------------

     Pid Command    Inuse  Pin  Pgsp  Virtual   64-bit    Mthrd

13658   at       19296  1605  1820  13917    Y        Y

 

Real Memory Check

l Real Memory 사용률이 높은 3개의 프로세스를 체크하는 방법

 

% ps gu|head -n 1;ps gu|egrep -v "CPU|kproc"|sort +3b -n -r|head -n 3

 

USER  PID %CPU %MEM  SZ  RSS    TTY STAT  STIME TIME

qa64  31462  0.5   4.0  141680 143816   - A     04:40:11  5:12

qa64  13658  0.5   1.0   38536  40584    A     04:24:05  5:23

qa64  26852  0.5   1.0   41320  43804   - A     04:39:39  4:59

…………

 

시스템 관련

 

LOG 확인

l syslog

 

기본적으로 /var/adm/syslog 여기에 위치해 있으나 없는 경우는 아래 syslog.conf 설정되어 있는 파일 경로에서 찾으면 확인 가능하다.

 

l syslog.conf

 

% vi /etc/syslog

 

마지막 부분에

# example:

# "mail messages, at debug or higher, go to Log file. File must exist."

# "all facilities, at debug and higher, go to console"

# "all facilities, at crit or higher, go to all users"

#  mail.debug           /usr/spool/mqueue/syslog

#  *.debug              /dev/console

#  *.crit                       *

#  *.debug              /tmp/syslog.out     rotate size 100k files 4

#  *.crit               /tmp/syslog.out     rotate time 1d

 

운영 체제 버전 확인

l Oslevel

 

5.1.0.0  또는  4.3.3.0  버전(Version) 으로 표시

 

l uname -M

 

IBM,7025-6F1

 

l uname -a

 

AIX aix 1 5 0001D01F4C00

 

패치 번호 확인

l lslpp

 

% lslpp -L | grep motif

X11.adt.motif            5.1.0.0   C  F  AIXwindows Application

X11.motif.lib             5.1.0.10  C  F  AIXwindows Motif Libraries

X11.motif.mwm          5.1.0.0   C  F  AIXwindows Motif Window Manager

X11.msg.ko_KR.motif.lib  5.1.0.0   C  F  AIXwindows Motif Libraries

X11.msg.ko_KR.motif.mwm  5.1.0.0  C  F  AIXwindows Motif Window Mgr Msgs

 

디스크 관련

 

디스크 I/O 정보

l iostat

 

Usage : iostat [ -s ] [ -a ] [ -d | -t ] [ PhysicalVolume ... ] [ Interval [ Count ]

 

% iostat 3 1

tty:  tin    tout   avg-cpu:  % user  % sys   % idle  % iowait

     0.0   388.0              23.6     16.0    54.7       5.8   

 

디스크:       % tm_act     Kbps      tps    Kb_read   Kb_wrtn

hdisk1           0.1       5.8       0.1      14287   8650449

hdisk0           0.0       0.0       0.0          0         0

hdisk2           0.0       0.0       0.0          0       244

cd0              0.0       0.0       0.0          0         0

 

크리에이티브 커먼즈 라이선스
Creative Commons License